Re: Matching/replacing

2003-11-13 Thread R. Joseph Newton
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:

Re: Matching/replacing

2003-11-13 Thread R. Joseph Newton
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

Re: Matching/replacing

2003-11-12 Thread Andrew Gaffney
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

RE: Matching/replacing

2003-11-12 Thread Bob Showalter
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)/

Re: Matching/replacing

2003-11-12 Thread Jeff 'japhy' Pinyan
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

Re: Re: Matching/replacing

2003-11-12 Thread LoneWolf
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

Re: Matching/replacing

2003-11-12 Thread Rob Dixon
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 =~

Re: Re: Matching/replacing

2003-11-12 Thread Rob Dixon
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