Ignoring ascii carriage return characters in R

399 Views Asked by At

I've a dataset in tab delimited text file. The data have been exported from an old-school relational database software 4D. Most of the lines seems to be well formated but some lines include an ASCII carriage return character (^M in Emacs or Ascii code 13). I would like to read the data in R using a function such as read.table() and to find a way to ignore those ascii carriage return symbols. Does anyone have a solution ?

1

There are 1 best solutions below

0
On

In Vim you can create the ^M character by typing control-v control-m

So you could replace every occurence of ^M with:

:%s/<c-v><c-m>//g