Re: Stripping HTML from a text file.

2003-09-05 Thread Randal L. Schwartz
> "Sara" == Sara <[EMAIL PROTECTED]> writes: Sara> I have a couple of text files with html code in them.. e.g. Sara> -- Text File -- Sara> Sara> Sara> This is Test File Sara> Sara> Sara> This is the test file contents Sara> Sara> blah blah blah

Re: [Addendum] Stripping HTML from a text file.

2003-09-05 Thread Octavian Rasnita
#x27;" <[EMAIL PROTECTED]> Cc: "beginperl" <[EMAIL PROTECTED]> Sent: Wednesday, September 03, 2003 4:08 PM Subject: [Addendum] Stripping HTML from a text file. > Okay, when I finally implemented this, again its not working ... any ideas? > simple regex like s///g; i

Re: [Addendum] Stripping HTML from a text file.

2003-09-04 Thread drieux
On Wednesday, Sep 3, 2003, at 06:08 US/Pacific, Sara wrote: #!/usr/bin/perl use LWP::Simple; print "Content-type: text/html\n\n"; $url = 'http://yahoo.com'; $html = get($url); [snip] $html =~ s|.*?<\/head>||s; print "$html\n"; what you get from 'get' is a scalar $html that is the WHOLE PAGE

[Addendum] Stripping HTML from a text file.

2003-09-04 Thread Sara
L PROTECTED]> To: "Hanson, Rob" <[EMAIL PROTECTED]>; "'Wiggins d'Anconia'" <[EMAIL PROTECTED]> Cc: "beginperl" <[EMAIL PROTECTED]> Sent: Wednesday, September 03, 2003 4:34 PM Subject: Re: Stripping HTML from a text file. : Tha

Re: Stripping HTML from a text file.

2003-09-04 Thread drieux
On Thursday, Sep 4, 2003, at 17:55 US/Pacific, Hanson, Rob wrote: $text =~ s|().*?.*?.*?()|$1$2$3|s; actually that should be: $text =~ s|().*?(.*?).*?()|$1$2$3|s; way stylish! I actually like. But assumes that there will be a title element - otherwise it will fail and not clear out the other s

Re: Stripping HTML from a text file.

2003-09-04 Thread Wiggins d'Anconia
drieux wrote: It could just be my OCD, but if I could have hammered flat every FROOOTLOOP who wanted merely a 'quick and dirty' one time only fix, 'honest, it's just this one time', rather than actually cure the root cause problem, WE would be on a flat earth from all the pounding That or we

Re: Stripping HTML from a text file.

2003-09-04 Thread Sara
x27;Anconia'" <[EMAIL PROTECTED]>; "'Sara'" <[EMAIL PROTECTED]> Cc: "beginperl" <[EMAIL PROTECTED]> Sent: Friday, September 05, 2003 5:55 AM Subject: RE: Stripping HTML from a text file. : > Or maybe I misunderstood the question : : Or maybe I d

Re: Stripping HTML from a text file.

2003-09-04 Thread drieux
On Thursday, Sep 4, 2003, at 17:55 US/Pacific, Hanson, Rob wrote: [..] I agree... but only if you are looking for a strong permanant solution. The regex way is good for quick and dirty HTML work. [..] technically we agree right up to the 'quick and dirty' part... I mean, how many times have we wa

RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
04, 2003 8:48 PM To: 'Sara' Cc: beginperl Subject: Re: Stripping HTML from a text file. Won't this remove *everything* between the given tags? Or maybe I misunderstood the question, I thought she wanted to remove the "code" from all of the contents between two tags? Becaus

Re: Stripping HTML from a text file.

2003-09-04 Thread drieux
On Wednesday, Sep 3, 2003, at 03:32 US/Pacific, Sara wrote: [..] What I want to do is to remove/delete HTML code from the text file from a certain tag upto certain tag. For example; I want to delete the code completely that comes in between and (including any style tags and embedded javascrip

Re: Stripping HTML from a text file.

2003-09-04 Thread Wiggins d'Anconia
for Win [untested]) perl -e '$x=join("",<>);$x=~s|.*?||s' myfile.html > newfile.html Rob -Original Message- From: Sara [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 6:32 AM To: beginperl Subject: Stripping HTML from a text file. I h

RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
tml Rob -Original Message- From: Sara [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 6:32 AM To: beginperl Subject: Stripping HTML from a text file. I have a couple of text files with html code in them.. e.g. -- Text File -- This is

Stripping HTML from a text file.

2003-09-04 Thread Sara
I have a couple of text files with html code in them.. e.g. -- Text File -- This is Test File This is the test file contents blah blah blah. - What I want to do is to remove/delete HTML code from the text