File processing

Skip Montanaro skip at pobox.com
Tue Jul 10 13:01:03 EDT 2001


    Donn> That's cool, but you might be interested to see if tail on your
    Donn> platform supports a positive index (bet it does):

It works, but with no discernable effect

    % tail +1 dnd.txt > dnd.txt.short 
    % wc -l dnd.txt*
       1015 dnd.txt
       1015 dnd.txt.short
       2030 total

    Donn> In the unlikely event it doesn't, sed '1d' is a safe bet.

Even better:

    % sed -e 1d < dnd.txt > dnd.txt.short 
    % wc -l dnd.txt*
       1015 dnd.txt
       1014 dnd.txt.short
       2029 total

Learn somethin' every day...

Skip




More information about the Python-list mailing list