如何阅读文件" mydata.bin"进入R.

时间:2016-07-26 08:13:09

标签: r python-2.7

我有几个扩展名为.bin的文件,例如select column1, column2, column3, column1 + column2 + column3 from t42; COLUMN1 COLUMN2 COLUMN3 COLUMN1+COLUMN2+COLUMN3 ---------- ---------- ---------- --------------------------------------- 1 2 3 6 1 -3 1 2 3 6 mydata1.bin等。我想将这些文件读入R,以便我可以将它们构建成数据框。

文件包含以下数据:

mydata2.bin

分隔符为:"2016-07-22`353032173`kataraqatar`Katara was born out of a long held vision to position Qatar as an international cultural lighthouse. We will be sharing Katara's latest news and updates.`15`224247`1`280`Doha, Qatar`Kuwait`16485`2016-07-21 17:01:13`4`756172188416413696`NULL`NULL`und`False`2`لكي تكون قريب من فعاليات وأنشطة #كتارا اتصل على 182Be close to the #Katara events and activities, by calling: 182 url`NULL`NULL`url 2016-07-22`353032173`kataraqatar`Katara was born out of a long held vision to position Qatar as an international cultural lighthouse. We will be sharing Katara's latest news and updates.`15`224247`1`280`Doha, Qatar`Kuwait`16485`2016-07-21 15:00:59`14`756141931495915520`NULL`NULL`ar`False`1`يُلقي خطبة الجمعة فضيلة الشيخ محمد مكي، إمام وخطيب جامع #كتارابعنوان "الثقة بالله في الأزمات"#كتارا_ملتقى_الثقافات url`NULL`NULL`url 2016-07-22`353032173`kataraqatar`Katara was born ..... "

1 个答案:

答案 0 :(得分:0)

沿着这条线可能还有什么东西?

select product from category where id='1'. 

创建文件的矢量,通过读取product: id | name category: id | name category_product: product_id | category_id 个分隔的条目,遍历此列表以创建数据帧列表。

然后,行将列表的每个数据帧绑定到最终的数据帧中。