R: is it possible to read/process flat file in R -
i want use r scripting , having problem using syntax load flat test1.txt created on w machine in text editor. later plan replace string in , write out.
search r option , promising still produces errors error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 2 did not have 6 elements etc or incomplete final line found readtableheader on 'c:/r/x/xxx1.sql'
read.table("c:/r/x/xxx1.sql") is doable in r? don't care columns structures, it's free text file.
thanks mario
you should use ?readchar , ?writechar, want whole content in same character vector. each function has purpose. ?readlines iterate on lines, ?read.table parse tabulated files.
file.content <- readchar(file.name, file.info(file.name)$size)
Comments
Post a Comment