Shell – how to delete a header without deleting other rows in linux

linuxshell

I have a huge data file.txt looks like :

calls...
12311 34213 13344 12345 34532
23345 24445 22445 12344 12333
34456 22211 12334 12234 23344
23345 24445 22445 12344 12333

which I want to delete first row(which is written calls… there).

I used this command:

sed '1d' input.txt > output.txt

which deletes "calls…" . But the problem is that some other rows gets deleted as well. Does any body has any other suggestion that help me to delete calls… without deletion of the other rows inside? my real data has 117,000 rows and 10,000 column when I use this command then the number of rows gets 68,645 , while it must get 116,999. when I try sed in small data like the example I showed here, the number of rows does not change, while in my real data it does. I am really confused why?

Best Answer

You could use tail

tail -n +2 input.txt > output.txt

will print the lines of the file starting by the second (note the + sign)

Related Question