Reputation: 4563
I have a file that's delimited by a special character (ctl-A, which has an ASCII code of 1, 0x01 in hex) that I'd like to import into an R dataframe. In vi
it looks like this:
How do I import this file?
Upvotes: 1
Views: 421
Reputation: 269606
That character can be used in sep=
> Lines <- "abc\1def\nABC\1DEF"
> read.table(text = Lines, sep = "\1")
V1 V2
1 abc def
2 ABC DEF
Upvotes: 1