I have output streamed as text in the following form:
[2] "TWS OrderStatus: orderId=12048 status=PreSubmitted
filled=0 remaining=300 averageFillPrice=0 "
[3] "TWS OrderStatus: orderId=12049 status=PreSubmitted
filled=0 remaining=300 averageFillPrice=0 "
I would like to capture such output and convert it to a data frame with columns: orderId, status, filled, remaining, averageFillPrice
.
I am wondering what is the most efficient way to do it.
I tried capturing it with capture.output
but then I am not so sure how to covert it to a data frame.