In our last episode,
< >,
the lovely and talented Shaf
broadcast on comp.lang.perl.misc:
> I am new to Perl and have a question regarding deleting header data
> from a text file. I have a set of files that I need to delete data
> from. Is there something in Perl to delete string data?
Lots of things. This is the sort of thing that perl is especially
good for.
> What is the best way for me to handle this?
Not enough information. Are the strings to be deleted unique? Do
they fit a unique pattern? Are the headers you want to delete always
the same length and in the same position in the file? Is there
a unique separator between the header information and the text?
Are there embedded newlines in some of the headers?
In the simplest cases, the s/// operator can be used to search
and replace, searching for the unique header strings or for a
regular expression for the unique header string pattern and
replacing with nothing. This can often be done with a perl
"one-liner."
--
Lars Eighner -finger for geek code-
http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.