[Boulder.pm] Perl Help

Dave Gray yargevad at gmail.com
Sun Apr 1 21:55:35 PDT 2007


On 3/31/07, Rod Burgess <rodbandkimb at msn.com> wrote:
> 14567345;1;Oil Seal
> 4533457C;1;Heat Shield
> 56842204;1;Misc Part
> 5481206D;1;Gasket
> 81003589I;1;Washer
> T23546II;1;Shirt
[becomes]
> 14567345;1;Oil Seal
> 4533457 C;1;Heat Shield
> 56842204;1;Misc Part
> 5481206 D;1;Gasket
> 81003589 I;1;Washer
> T23546 II;1;Shirt

One-liners for fun and profit!

perl -pi.bak -e 's/^(\d+)([CD]|I{1,2});/$1 $2;/' fileglob

If you haven't done so, reading the 'perldoc perl' docs is enlightening.


More information about the Boulder-pm mailing list