R读取制表符分隔的文本文件

时间:2016-02-08 06:52:49

标签: r read.table

我有一个相当混乱的制表符分隔文本文件,看起来像这样(这里是2个第一行):

data <- read.table("nir_test.csv",header = FALSE, sep = "\t")

尝试使用读取表将其加载到R时:

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  line 2478 did not have 15 elements

我收到错误:

1.5 dp  lax4    {307:307,564:564}   [307,564]   riskofrain.wikia.com    appnexus    http://riskofrain.wikia.com/wiki/Character_Unlocks  c       1454824416  2016    2   75

任何有关阅读这些文件的正确方法的帮助表示赞赏 感谢

更新: 这是中风线:

<welcome-file-list>
    <welcome-file>faces/hello.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

问题是最后2列没有用制表符分隔(7和5),实际上根本没有分开

0 个答案:

没有答案