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 ($line = <OLDFILE>)  {
> #               $line = $line =~ /^\s*(.*)\s*\n$/;
>                 $line =~ s/^ //;
>                 $line =~ s/ $//;
>                 $line =~ s/\t/|/g;
>                 $line =~ s/\s+/ /mg;
>                 $line =~ s/^\s*//mg;
>                 $line =~ s/\s*$//mg;
>                 $line =~ s/\s*$//mg;
> ###  The following lines mod the files to reflect inches and feet
>                 $line =~ s/"/in./mg;
>                 $line =~ s/'/ft./mg;
>                 print NEWFILE "$line\n";
>
> help!

With what?  Is what you wrote not working?  So far, you have told us about what
you are trying to do, and the code you are using to achieve it.  That is very
good.  What you haven't told us about is the results you get when you test it,
or what your cause for dissatisfaction might be.

Right offhand, I'd say that you have a lot of code for a very simple problem,
but I can't see looking farther into it until you test it for yourself and let
us know what results you get.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to