You can approach this in two different ways:
and. If the file is not too wide, you can read the necessary lines with scanand divide it into the necessary columns with strsplit, and then combine into data.frame. Example:
your_text <- "a~b~c!1~2~meh!4~5~wow"
write(your_text,"raw.txt"); rm(your_text)
eol_str = "!"
sep_str = "~"
f <- file("raw.txt")
row_list <- sapply(scan("raw.txt", what=character(), sep=eol_str),
strsplit, split=sep_str)
close(f)
df <- data.frame(do.call(rbind,row_list[2:length(row_list)]))
row.names(df) <- NULL
names(df) <- row_list[[1]]
df
. A , @BondedDust, , , , R system() / read.table. . : https://askubuntu.com/questions/20414/find-and-replace-text-within-a-file-using-commands. , \n \r\n, - , , - , data.frame.