in reply to Re: Running complex sed from perl
in thread Running complex sed from perl
here is the code that I used, to test based on the the information given, I used a perl one liner to validate it works without a hitch
perl -pi.back -e 's#\D*(\d{3})\D*(\d{3})\D*(\d{4})#(${1}) ${2}-${3}#s;' clients.txtNow of course, I realized the flaw in my thinking, and several components of the script are completely written on Linux systems, the flaw of course is that when testing the perl script on a windows system without say cgywin and only strawberry or absolute perl calls for awk and sed will not work. Luckly at this point there is only a single awk command left. All it does is place double quotes around each line in the output.txt file so that the perl script can then modify the other lines with the necessary formating. If I can figure out how to get double quotes at the begining and end of each line, then when its formated it can be converted into a CSV file and imported into a DB.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Running complex sed from perl
by shmem (Chancellor) on Dec 02, 2013 at 03:29 UTC | |
by sunglant (Initiate) on Dec 02, 2013 at 23:39 UTC | |
by aaron_baugher (Curate) on Dec 02, 2013 at 23:51 UTC | |
|
Re^3: Running complex sed from perl
by 2teez (Vicar) on Dec 02, 2013 at 05:15 UTC | |
|
Re^3: Running complex sed from perl
by wazat (Monk) on Dec 02, 2013 at 04:35 UTC |