Delete first line of text file Delete first line of text file windows windows

Delete first line of text file


Windows/command prompt:

more +1 filename.ext > otherfilename.ext

That seems to work fine, however it appears that this also converts tab characters into multiple spaces..I needed to remove the first line of a tab-delimited file before importing into postgres.That failed due to the automatic conversion of tabs to spaces by more...


You didn't specify a platform. Here's how to do it in any *NIX environment (and Windows+Cygwin):

sed -i~ 1d target-file


To remove the first line, I would use

tail -n +2 source-file > target-file

If you want this on Windows, download the gnu utils to obtain a tail command. +2 means "Start at the second line".