dirtdog has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I'm struggling with the task of capturing a date value that is populated in column 8 of a pipe delimited file and inserting it into column 11.
row|1|CUSIP|12345678|RED|||20150125|||| row|1|CUSIP|1234A82H|RED|||20150316||||
for the 2 examples above the final result should be:
row|1|CUSIP|12345678|RED|||20150125|||20150125| row|1|CUSIP|1234A82H|RED|||20150316|||20150316|
I know i need to use memory parens to capture the value in column 8, but can't seem to get it to work
perl -pi -e 's/\(RED|||([0-9]{8})|||\)/\1/g'
The above is what i have so far.
Thanks for any suggestions
|
|---|