in reply to Re^3: Inherited a perl script...need help (s///)
in thread Inherited a perl script...need help
I tried the code Stevie gave me, but it did the same thing my original code was doing. It found any match of 4 digits and replaced it with 9999. This led me to a way of patching the issue and fixing it in a text editor using block selection. Replacing 0030 with AAAA, replacing 0031 with BBBB ect ect. Basically I need the code to match the 4 character number and replace with a 4 character number. Any numbers of more or less character in a field should be ignored. I hope this helps clarify. My code that I used to clunk my way through the issue.
$line =~ s/0030/AAAA/g; $line =~ s/0031/BBBB/g; $line =~ s/0884/CCCC/g; $line =~ s/0716/DDDD/g; $line =~ s/0528/EEEE/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Inherited a perl script...need help (s///)
by blindluke (Hermit) on Nov 11, 2015 at 21:45 UTC | |
|
Re^5: Inherited a perl script...need help (s///)
by Preceptor (Deacon) on Nov 12, 2015 at 22:50 UTC |