[CDBUG-talk] Weird scripting question
jaime at snowmoon.com
Fri Feb 10 12:56:13 EST 2017
I have a weird scripting question. I have two vendors: One is providing a
CSV file of people, their ID#s, the building where they work, etc.; the
other is requesting a CSV file of that data in a different format. I'm
currently doing the conversion between these two formats via awk inside a
bash script. (The script also grabs the first file over SFTP and uploads
the post-processed file to another server via SFTP.)
So I have a data file from the first vendor that says:
I need to send it to the vendor that automates emergency phone calls (in
the event of closure due to snow and things like that.) The second vendor
will only list Fred Flintstone as working in the Middle School, since the
two lines have the same employee ID#.
I was told by the second vendor to change the lines to be more like:
Fred Flintstone,b111,Middle School
Betty has the same ID# because there is only one record for her. Fred gets
"a" and "b" prepended because there are two entries and we need to be sure
they have different ID#s.
Any idea how to do this? Is it even possible with awk?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CDBUG-talk