Reading PSV (pipe-separated) file or string

北慕城南 提交于 2019-11-28 05:19:47

问题


I have just received a data file, whose extension is "*.psv". After doing a bit of research, I don't know how to open it R.


回答1:


Thanks to hrbrmstr, I found the answer. We could use read.csv to read *.psv file.

read.csv("myfile.psv", sep = "|", header = FALSE, stringsAsFactors = FALSE)

There might be many different representations of psv file, but when it comes to data mining, I think it might be more about "pipe separated" file. The data in the file is separated by "|"



来源:https://stackoverflow.com/questions/28966203/reading-psv-pipe-separated-file-or-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!