[tpm] Fast(er) way of deleting X lines from start of a file

Viktor Pavlenko vvp at cogeco.ca
Wed Sep 30 11:29:54 PDT 2009


>>>>> "AS" == Antonio Sun <antoniosun at lavabit.com> writes:

    AS> [...]

    AS> If using shell script instead of Perl is an option, then  sed is the best
    AS> tool

    AS>   ToDel=20
    AS>   sed -i "1,${ToDel}d" file

    AS> will delete the first 20 lines from the file.

perl -i -ne 'print if $. > 20' file

(my two cents in Perl)

-- 
Viktor



More information about the toronto-pm mailing list