title: Control file based attribute population : Unix shell
body: <p>I have a control file header.cntrl. it has details of header. Example below...</p>
  <pre><code>cat header.cntrl
  id, name, age, location, phone number
  </code></pre>
  <p>Now I am getting files from different sources,</p>
  <p>Source 1 is sending input.dat file in the following format</p>
  <pre><code>cat input.dat
  id, name, age, location, status, phone number
  1,Abc, 34,India, active, 9999999999
  </code></pre>
  <p>Source 2 is sending data in the following format</p>
  <pre><code>cat input_2.dat
  id, age, name, qualification, status, phone number, location
  2,24,xyz, L L B, Active, 88888-88888, India
  </code></pre>
  <p>So different sources are sending files in different formats. We would need to convert those input files to header.cntrl file format.</p>
  <p>I was trying this using awk code, but for each source, I'll need to write an awk code.  Can we do it with a single script which can be used for any new future source as well?</p>