我有输出流作为文本在以下形式:捕获文本输出作为结构化数据帧
[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 "
我想捕捉这样的输出,并将它与列转换为一个数据帧:orderId, status, filled, remaining, averageFillPrice
。
我想知道什么是最有效的方式来做到这一点。
我试图用capture.output
捕获它,但后来我不确定如何将它转换为数据帧。
你的意思是 “流”? – nrussell
该功能连接到财务网站,并在发生时返回信息。不管怎样,我在5秒内关闭连接 – kalka
我们很难重现您的程序。你正在通过“功能”来讨论“输出流”,这使我们很难考虑如何帮助你。我们甚至不知道您捕获的输出是什么类型的对象。请阅读http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – coffeinjunky