title: Unix (ksh) script to read file, parse and output certain columns only
body: <p>I have an input file that looks like this:</p>
  
  <pre><code>"LEVEL1","cn=APP_GROUP_ABC,ou=dept,dc=net","uid=A123456,ou=person,dc=net"
  "LEVEL1","cn=APP_GROUP_DEF,ou=dept,dc=net","uid=A123456,ou=person,dc=net"
  "LEVEL1","cn=APP_GROUP_ABC,ou=dept,dc=net","uid=A567890,ou=person,dc=net"
  </code></pre>
  
  <p>I want to read each line, parse and then output like this:</p>
  
  <pre><code>A123456,ABC
  A123456,DEF
  A567890,ABC
  </code></pre>
  
  <p>In other words, retrieve the user id from "uid=" and then the identifier from "cn=APP_GROUP_".  Repeat for each input record, writing to a new output file.</p>
  
  <p>Note that the column positions aren't fixed, so can't rely on positions, guessing I have to search for the "uid=" string and somehow use the position maybe?</p>
  
  <p>Any help much appreciated.</p>