我有以下类似文本(csv)文件要阅读,其中前四列是我感兴趣的,但之后我有很多垃圾。我只想将前四列读入 R。
我想要前四列,这样输出(在 excel 中打开的 csv)看起来像:
由于 SO 的限制,我无法粘贴整个文件或附加它。这是锻炼的较小示例:
type,latitude,longitude,name,link1,
W,43.075319,-89.386145,Mirch Masala,"<just link, jjksskkls hskks > ","<just link, jjksskkls hskks > "
W,43.07488,-89.390698,Himal Chuli Restaurant,"<just link, jjksskkls hskks > ","<just link, hskks , hsksks > "
W,43.074887,-89.391011,Chautara Restaurant,"<just link, hskks , hsksks > ","<just link, jjksskkls hskks > "
W,43.092866,-89.351587,Dobhan Restaurant,"<just link, jjksskkls hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.074746,-89.393137,State Street Cash Mart,"<just link, jjksskkls hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.072801,-89.395718,Dotty Dumplings Dowry,"<just link, jjksskkls , hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.074744,-89.393046,Dobra Tea,"<just link, jjksskkls hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.076372,-89.380231,Hi-Madison,"<just link, jjksskkls hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.019624,-89.421822,Candlewood Suites Fitchburg,"<just link, jjksskkls , ssjjs hskks > ","<just link, jjksskkls , ssjjs hskks > "
W,43.08154,-89.524094,Holiday Inn Hotel & Suites Madison West,"<just link, jjksskkls 100 hskks > ","<just link, jjksskkls , ssjjs hskks > "
在导入 R 时只阅读前四列有什么想法吗?