<div dir="ltr"><div>Could that be `111` and then `111a`, etc.?  If so, you might add each employee id to a data structure in awk, appending something to the id if it's already in that data structure until finding a unique string.<br><br></div><div>How do that in awk, I don't know -- I haven't read sed&awk for a long time!!<br></div><div><br></div>Dustin<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-10 12:56 GMT-05:00 Jaime <span dir="ltr"><<a href="mailto:jaime@snowmoon.com" target="_blank">jaime@snowmoon.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.)<div><br><div>So I have a data file from the first vendor that says:</div><div>Fred,Flinstone,111,High School</div><div>Fred,Flintstone,111,Middle School</div><div>Betty,Rubble,112,MiddleSchool</div><div><br></div><div>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#.<br><br>I was told by the second vendor to change the lines to be more like:</div><div>Fred,Flintstone,a111,High School</div><div>Fred Flintstone,b111,Middle School</div></div><div>Betty,Rubble,112,Middle School</div><div><br></div><div>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.</div><div><br></div><div>Any idea how to do this?  Is it even possible with awk?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Jaime</div></font></span></div>
<br>______________________________<wbr>_________________<br>
CDBUG-talk mailing list<br>
<a href="mailto:CDBUG-talk@lists.nycbug.org">CDBUG-talk@lists.nycbug.org</a><br>
<a href="http://lists.nycbug.org/mailman/listinfo/cdbug-talk" rel="noreferrer" target="_blank">http://lists.nycbug.org/<wbr>mailman/listinfo/cdbug-talk</a><br></blockquote></div><br></div>