2

I have a lot of very large txt-files that have a header I would like to remove.
Is there a way to do this without reading in the entire file?
Possibly using the system() command?
I found some ideas here but I haven't been able to make them work. I am using Windows 7 and R Version 3.2.2.

Here is what I have tried:

> systCommand <- paste0("echo '$(tail -n +2 ",  myFilePath, ")' > ", myFilePath)
> system(systCommand, intern=T)
Error in system(systCommand, intern = T) : 'echo' not found

I am pretty sure that this is because I am using windows?

Community
  • 1
  • 1
statsNoob
  • 1,325
  • 5
  • 18
  • 36

1 Answers1

-3

after reading in

count_table <- read.table("your path/filename.txt")
head(count_table)

if the first row is header,

c_table <- count_table[-1,]
head(c_table)

then, the first line of header can be removed

cying Jack
  • 11
  • 3