• Removing the first line of a large text file

    I have a large text file (over 4GB in size) and need to remove the very first line. Opening the file in a text editor naturally doesn’t make any sense (and would likely cause the editor to run out of memory). The easiest and fastest solution I have found so far is, in the terminal to type:

    tail -n +2 src-file > dst-file

    I know this works on OS X and on Linux. I don’t know (or really worry about) what the Windows equivalent is. If you want to make sure that what you have done worked, you can have a look at the head of the dst-file:

    head dst-file
    Post Tagged with , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human: *