[Chicago-talk] delete the first line in a text file.
James Keenan
jkeen at verizon.net
Fri Jul 29 19:41:17 PDT 2005
On Jul 29, 2005, at 2:08 PM, Richard Reina wrote:
>
>
> Anyone know the easiest way remove the 1st line in a
> text file. I was thinking it should be something
> like:
>
> upen(FILE, "text.txt");
> # delete the 1st (top) line
>
> close(FILE);
>
>
> but I've obviously come up short.
>
Given the simplicity of the problem you pose, what follows is NOT the
best way to solve the problem. But it is a useful way to approach many
problems of this sort:
perldoc Tie::File
(or: http://search.cpan.org/dist/Tie-File/)
jimk
More information about the Chicago-talk
mailing list