LoneWolf wrote:
I have to parse a big file and I do it line by line to keep stuff going
correctly. I am at a point where I need it to go through and replace every
with inches and ' with feet, IF item in front of it is a digit (0-9).
I have this written in the script to parse it:
LoneWolf wrote:
Here's the cleanup script as it stands right now. The problem with the file
that comes out is leading white space after each |
Then focus on the pipe.
$_ =~ s/\s*\|\s*//g;
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
LoneWolf wrote:
I have to parse a big file and I do it line by line to keep stuff going
correctly. I am at a point where I need it to go through and replace every
with inches and ' with feet, IF item in front of it is a digit (0-9).
I have this written in the script to parse it:
while
LoneWolf wrote:
I have to parse a big file and I do it line by line to keep stuff
going correctly. I am at a point where I need it to go through and
replace every with inches and ' with feet, IF item in front of it
is a
digit (0-9).
You can use:
s/(\d)/$1 inches/g
or
s/(?=\d)/
On Nov 12, Rob Dixon said:
[EMAIL PROTECTED] wrote:
I have this written in the script to parse it:
while ($line = OLDFILE) {
# $line = $line =~ /^\s*(.*)\s*\n$/;
$line =~ s/^ //;
$line =~ s/ $//;
$line =~ s/\t/|/g;
$line =~ s/\s+/ /mg;
$line =~ s/^\s*//mg;
$line
Whoops, sorry. Name's Robert
The problem even with doing redundent things is that the dedundency's didn't
clean up the extra white spaces in each line.
I glob in the whole file, bad, I know, but it's what I know and what works,
it also gives no overhead on the server and the script takes less
Jeff 'Japhy' Pinyan wrote:
On Nov 12, Rob Dixon said:
[EMAIL PROTECTED] wrote:
I have this written in the script to parse it:
while ($line = OLDFILE) {
# $line = $line =~ /^\s*(.*)\s*\n$/;
$line =~ s/^ //;
$line =~ s/ $//;
$line =~ s/\t/|/g;
$line =~
Hi Robert.
Robert wrote:
The problem even with doing redundent things is that the dedundency's didn't
clean up the extra white spaces in each line.
I glob in the whole file, bad, I know, but it's what I know and what works,
it also gives no overhead on the server and the script takes less