title: change the date formats to modified ISO date in multiple column in each line using awk or sed
body: <p>Input file</p>
  <pre><code>xyz|name1|address1|19600221|M|country1|20200129|etc1
  xyz|name2|address2|19610321|M|country2|20200118|etc1
  xyz|name3|address3|19520217|M|country3||etc1
  xyz|name4|address4|19611111|M|country4||etc1
  </code></pre>
  <p>expected output</p>
  <pre><code>xyz|name1|address1|1960-02-21|M|country1|2020-01-29|etc1
  xyz|name2|address2|1961-03-21|M|country2|2020-01-18|etc1
  xyz|name3|address3|1952-02-17|M|country3||etc1
  xyz|name4|address4|1961-11-11|M|country4||etc1
  </code></pre>
  <p>Code that I used</p>
  <pre><code>awk -F&quot;|&quot; '{OFS=&quot;|&quot;;$4=strftime(&quot;%Y-%m-%d&quot;, $4); print$0}' input.txt
  </code></pre>
  <p>and redirect the output to new file and ran the same for the 7th column but the result is not as expected and I got the below</p>
  <pre><code> xyz|name1|address1|1960-02-21|M|country1|1970-08-22|etc1
      xyz|name2|address2|1961-03-21|M|country2|1970-08-22|etc1
      xyz|name3|address3|1952-02-17|M|country3|1970-01-01|etc1
      xyz|name4|address4|1961-11-11|M|country4|1970-01-01|etc1
  </code></pre>
  <p>I couldn't understand why the column 7 output is different? Any advise on what is wrong here?</p>