Re: Getting rid of white space...

2003-09-08 Thread R. Joseph Newton
"Akens, Anthony" wrote: > > The files are all pipe-delimited, so I don't have a problem separating the > > fields, I just am not sure how to make it remove all extra whitespace. It > > needs to keep all Space in the fields "thedescription of the > > > file" should still b

Re: Getting rid of white space...

2003-09-04 Thread John W. Krahn
"John W. Krahn" wrote: > > #!/usr/bin/perl > use warnings; > use strict; > > ( $\, $^I ) = ( $/, '.bak' ); > > while ( <> ) { > s/^\s+//; # remove space at beginning of line > s/\s+$//; # remove space at end of line > s/\s*\|\s*/|/g; # remove space around pipe separ

Re: Getting rid of white space...

2003-09-04 Thread John W. Krahn
Lonewolf wrote: > > I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. > THe files from the SCO box are poorly formatted with extraneous whitespace > (sometimes as much as 30 or more) before and after the text. I need to > parse all of the files I DL and put them into a n

RE: Getting rid of white space...

2003-09-04 Thread Bob Showalter
LoneWolf wrote: > I have about 12 files that I am pulling for a SCO box to a RedHat > box, FTP. THe files from the SCO box are poorly formatted with > extraneous whitespace (sometimes as much as 30 or more) before and > after the text. I need to parse all of the files I DL and put them > into a new

Re: Getting rid of white space...

2003-09-04 Thread Brian Harnish
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 04 Sep 2003 06:37:57 -0700, LoneWolf wrote: > I have about 12 files that I am pulling for a SCO box to a RedHat box, FTP. > THe files from the SCO box are poorly formatted with extraneous whitespace > (sometimes as much as 30 or more) before

RE: Getting rid of white space...

2003-09-04 Thread Perry, Alan
On Thursday, September 04, 2003 11:11, Marshall, Stephen wrote: > >Got it working this way fror the important line, but theres probably a slicker way of doing it. > >$line =~ s/(\s)+/ /g; > This will work, but may leave an extraneous space at the beginning and/or end of the line. This text: "

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
($line) = ($line =~ /^\s*(.*)\s*\n$/); print NEWFILE "$line\n"; } close OLDFILE; close NEWFILE; } -Original Message- From: Marshall, Stephen [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 11:11 AM To: Marshall, Stephen; Ake

RE: Getting rid of white space...

2003-09-04 Thread Marshall, Stephen
TECTED]; [EMAIL PROTECTED] > Subject: RE: Getting rid of white space... > > > I have a similar problem to this , does anyone have another > answer? Don't know if its just me but The > > > use strict; > > while(my $line = <>) { > > ($line) = ($li

RE: Getting rid of white space...

2003-09-04 Thread Marshall, Stephen
NEWFILE "$line\n"; > } > close OLDFILE; > close NEWFILE; > } > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 04, 2003 8:32 AM > To: [EMAIL PROTECTED]; [EMAIL PROT

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
e ($line = ) { ($line) = ($line =~ /^\s*(.*)\s*\n$/); print NEWFILE "$line\n"; } close OLDFILE; close NEWFILE; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 8:32 AM To: [EMAIL PR

RE: Getting rid of white space...

2003-09-04 Thread Akens, Anthony
e ($line = ) { ($line) = ($line =~ /^\s*(.*)\s*\n$/); print NEWFILE "$line\n"; } close OLDFILE; close NEWFILE; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 8:32 AM To: [EMAIL PR

RE: Getting rid of white space...

2003-09-04 Thread Marcos . Rebelo
are you speaking of this? use strict; while(my $line = <>) { ($line) = ($line =~ /^\s*(.*)\s*\n$/); print($line."_nice/n"); } -Original Message- From: LoneWolf [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:38 PM To: [EMAIL PROTECTED] Subject: Getting rid o