Hello all,
I have an issue where I'm trying to change a date in a csv text file. The file contains lines that have several fields. For example
"John", "Smith","some_address","some_city","555-555-5555","11/11/1972"
"Joan","User","some_address","some_city","444-444-4444","12/02/1963"
The date is separated by the "/" and is the date is the last field in the record, Field 12. What I would like to do is run AWK against the file and change the date from
dd/mm/yyyy to YYYYMMDD and have it stay in the same field on all records, so the output will look like this
"John","Smith","some_address","some_city","555-555-5555","YYYYMMDD"
"Joan","User","some_address","some_city","444-444-4444","YYYYMMDD"
I tried:
$ awk -F "/" '{print $3, $2, $1}'
but that returns the records in the format
YYYYMM,"John","Smith"......
Any one out there know how to solve this? Thanks in advance
Any ideas on how to accomplish this?