Find a pattern in a line, and append that matched pattern to the same line
I'm trying to pull a job number out of notes listed in a csv, and then
append that number to the end of the line, preferably through sed, awk or
grep.
Here's a mockup:
"HD1231203", "1231232","fake.name","Lots of text before the job 150232 and
then more"
"HD5164635", "8918123","more.fake","151243 and then some text"
"HD1541545", "8435413","last.fake","Oh look, we've got 150213 and 151487
this time!"
should become:
"HD1231203", "1231232","fake.name","Lots of text before the job 150232 and
then more", "150232"
"HD5164635", "8918123","more.fake","151243 and then some text","151243"
"HD1541545", "8435413","last.fake","Oh look, we've got 150213 and 151487
this time!","150213","151487"
I've tried what little I know with sed, but I'm honestly out of my depth.
No comments:
Post a Comment