Hi
I have a data file, named a_data, which contains like this:
3100340001|02.02.29|28800|03/20/2002|
I manage to write a simple awk script that converts
03/20/2002 to 2002-03-20:
ie
mlc_year = substr($4,7,4)
mlc_month = substr($4,1,2)
mlc_day = substr($4,4,2)
mlc_full_date = mlc_year"-" mlc_month "-" mlc_day
$4 = mlc_full_date
print $4
How do I write back to a_data file such that it contains
3100340001|02.02.29|28800|2002-03-20|
Any help is fully appreciated.
Thanks
I have a data file, named a_data, which contains like this:
3100340001|02.02.29|28800|03/20/2002|
I manage to write a simple awk script that converts
03/20/2002 to 2002-03-20:
ie
mlc_year = substr($4,7,4)
mlc_month = substr($4,1,2)
mlc_day = substr($4,4,2)
mlc_full_date = mlc_year"-" mlc_month "-" mlc_day
$4 = mlc_full_date
print $4
How do I write back to a_data file such that it contains
3100340001|02.02.29|28800|2002-03-20|
Any help is fully appreciated.
Thanks