title: script to convert Csv to xml
body: <p><strong>Need to process the file using for loop</strong></p>
  
  <p>I have written below code to convert csv to xml. Here have written separate tag for each column.<br>
  In input file have column from 1 to 278. In output file need to have tag from A1 to A278,  </p>
  
  <p>Code :</p>
  
  <pre><code>file_in="Prepaid_plan_voucher.csv"
  file_out="Prepaid_plan_voucher.xml"
  echo '&lt;?xml version="1.0"?&gt;' &gt; $file_out
  #echo '&lt;Customers&gt;' &gt;&gt; $file_out
  echo '  &lt;TariffRecords&gt;' &gt;&gt; $file_out
  echo '  &lt;Tariff&gt;' &gt;&gt; $file_out
  while IFS=$',' read -r -a arry
  do
  #  echo '  &lt;TariffRecords&gt;' &gt;&gt; $file_out
  #  echo '  &lt;Tariff&gt;' &gt;&gt; $file_out
    echo '    &lt;A1&gt;'${arry[0]}'&lt;/A1&gt;' &gt;&gt; $file_out
    echo '    &lt;A2&gt;'${arry[1]}'&lt;/A2&gt;' &gt;&gt; $file_out
    echo '    &lt;A3&gt;'${arry[2]}'&lt;/A3&gt;' &gt;&gt; $file_out
  #  echo '  &lt;/TariffRecords&gt;' &gt;&gt; $file_out
  #  echo '  &lt;/Tariff&gt;' &gt;&gt; $file_out
  done &lt; $file_in
  #echo '&lt;/Customers&gt;' &gt;&gt; $file_out
  echo '  &lt;TariffRecords&gt;' &gt;&gt; $file_out
  echo '  &lt;Tariff&gt;' &gt;&gt; $file_out
  </code></pre>
  
  <p>Sample Input file.(this is a sample record in actual input file will contain 278 columns).
  If input file has two or three records, same needs to be appended in one XML file.</p>
  
  <pre><code>name,Tariff Summary,Record ID No.,Operator Name,Circle (Service Area),list
  Prepaid Plan Voucher,test_All calls 2p/s,TT07PMPV0188,Ta Te,Gu,
  Prepaid Plan Voucher,test_All calls 3p/s,TT07PMPV0189,Ta Te,HR,
  </code></pre>
  
  <p>Sample output file
  
      
  The above two TariffRecords, tariff will be hard coded at the beginning and end of xml file.</p>
  
  <pre><code>&lt;TariffRecords&gt;
  &lt;Tariff&gt;
  &lt;A1&gt;Prepaid Plan Voucher&lt;/A1&gt;
  &lt;A2&gt;test_All calls 2p/s&lt;/A2&gt;
  &lt;A3&gt;TT07PMPV0188&lt;/A3&gt;
  &lt;A4&gt;Ta Te&lt;/A4&gt;
  &lt;A5&gt;Gu&lt;/A5&gt;
  &lt;A6&gt;&lt;/A6&gt;
  &lt;Tariff&gt;
  &lt;Tariff&gt;
  &lt;A1&gt;Prepaid Plan Voucher&lt;/A1&gt;
  &lt;A2&gt;test_All calls 3p/s&lt;/A2&gt;
  &lt;A3&gt;TT07PMPV0189&lt;/A3&gt;
  &lt;A4&gt;Ta Te&lt;/A4&gt;
  &lt;A5&gt;HR&lt;/A5&gt;
  &lt;A6&gt;&lt;/A6&gt;
  &lt;Tariff&gt;
  &lt;TariffRecords&gt;
  </code></pre>