我有輸出流作爲文本在以下形式:捕獲文本輸出作爲結構化數據幀
[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