"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
"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
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
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
-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
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:
"
($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
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
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
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
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
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
12 matches
Mail list logo