Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
Oops again, typo: >      s/^(^[>])/\n$1/; Should be s/^([^>])/\n$1/ ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
(Drat, keyboard glitch caused that to be sent before I was finished.) On Thu, Dec 30, 2010 at 5:19 AM, ken wrote: > > > - begin snippet - > while (<$in>) > { >    s/<(\w*\W)/<\L$1/g;         # Downcase XXX in "    s/<\/(\w*\W)/<\/\L$1/g;     # Downcase XXX in " s/^(^[>])/\n$

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
On Thu, Dec 30, 2010 at 5:19 AM, ken wrote: > > > - begin snippet - > while (<$in>) > { >    s/<(\w*\W)/<\L$1/g;         # Downcase XXX in "    s/<\/(\w*\W)/<\/\L$1/g;     # Downcase XXX in "    if(/^>/)                    # if this line starts with '>' >    {                      

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Jerry McAllister
On Thu, Dec 30, 2010 at 08:19:00AM -0500, ken wrote: It isn't perl, but does 'tr' exist in CentOS (it does in FreeBSD)? It would do it. jerry > > Given an HTML file which looks like this: > > - begin snippet - > > > >We've Lied to You… > NAME="GENERATOR" > CONTENT="Modula

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread ken
On 12/30/2010 11:01 AM John Doe wrote: > From: ken > >> Some file this script would need to process could very well be >> ridiculously huge, which is why I chose to process line-by-line. >> >> Secondly, yes, I was already using the general strategy of taking out >> the newlines (where they're

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread cpolish
John Doe wrote: > $ cat $FILE | tr "\n" " " | sed 's/ *>\n\nhttp://www.partmaps.org/era/unix/award.html#uucaletter -- "Pedantic, I?" -- Alexei Sayle ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Sean
Not sure exactly what you are trying to do, but Tie::File might be worth a look at if you haven't done so already? Sean ken wrote: > Given an HTML file which looks like this: > > - begin snippet - > >> > > We've Lied to You…> > > NAME="GENERATOR" > CONTENT="Modular DocBoo

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bowie Bailey
On 12/30/2010 10:24 AM, ken wrote: > On 12/30/2010 09:18 AM Bowie Bailey wrote: >> On 12/30/2010 8:19 AM, ken wrote: >>> Given an HTML file which looks like this: >>> >>> - begin snippet - >>> >>> >>> >>> We've Lied to You…>>> >> NAME="GENERATOR" >>> CONTENT="Modular DocBook HTML St

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread John Doe
From: ken > Some file this script would need to process could very well be > ridiculously huge, which is why I chose to process line-by-line. > > Secondly, yes, I was already using the general strategy of taking out > the newlines (where they're misplaced) and then putting them back in > (wh

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread ken
On 12/30/2010 09:18 AM Bowie Bailey wrote: > On 12/30/2010 8:19 AM, ken wrote: >> Given an HTML file which looks like this: >> >> - begin snippet - >> >> >> >> We've Lied to You…>> > NAME="GENERATOR" >> CONTENT="Modular DocBook HTML Stylesheet Version 1.79">> REL="HOME" >> TITLE="M

Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bowie Bailey
On 12/30/2010 8:19 AM, ken wrote: > Given an HTML file which looks like this: > > - begin snippet - > > > > We've Lied to You…> NAME="GENERATOR" > CONTENT="Modular DocBook HTML Stylesheet Version 1.79"> REL="HOME" > TITLE="Maximum RPM" > HREF="index.html"> REL="UP" > TITLE="Using R

[CentOS] perl code to remove newlines

2010-12-30 Thread ken
Given an HTML file which looks like this: - begin snippet - We've Lied to You… We've Lied to You… ) { s/<(\w*\W)/<\L$1/g; # Downcase XXX in "/)# if this line starts with '>' { # then $curr = tell $in;