Re: strip text up to a keyword?
From: Anno Siegel (anno4000_at_lublin.zrz.tu-berlin.de)
Date: 10/10/03
- Next message: Tad McClellan: "Re: data manipulation"
- Previous message: Raj: "Accepting HTTP Post"
- In reply to: Tad McClellan: "Re: strip text up to a keyword?"
- Next in thread: Tad McClellan: "Re: strip text up to a keyword?"
- Reply: Tad McClellan: "Re: strip text up to a keyword?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 10 Oct 2003 11:42:48 GMT
Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> kw <anon002001@yahoo.com> wrote:
>
> > Is there a relatively simple way to strip/delete all text from a file,
> > up to a keyword?
>
>
> No.
Well, there is, but the OP doesn't need it (because the text is in memory
anyway). This prints blocks from "BEGIN" to "END" from a file:
while ( <DATA> ) {
print if s/.*(?=BEGIN)// .. s/(?<=END).*//;
}
Anno
- Next message: Tad McClellan: "Re: data manipulation"
- Previous message: Raj: "Accepting HTTP Post"
- In reply to: Tad McClellan: "Re: strip text up to a keyword?"
- Next in thread: Tad McClellan: "Re: strip text up to a keyword?"
- Reply: Tad McClellan: "Re: strip text up to a keyword?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|