how to convert date column of a file into user input format



I have a file it has 7 columns and lacks of raws its date column format and number of date columns are dynamic, maybe one or two or three columns, date formats are DD-MON-YYYY HH24:MI or DD-MM-YYYY HH:MI or DD/MON/YYYY HH:MI etc..

file.txt

OIEX19|BANG37748|DEL37728|WUBXDE|200010291010|201209111625|195210290000
SEETA7|CHA38228|DEL37728|DGSDFE|201211190705|201308071912|195210291010
PRIYS3|ANK37748|DEL37728|KEJRSRC|196004080910|201407061815|195210292110

In the above column 5 and column 7 are date columns

User input date format is DD-MON-YYYY HH:MI

Desired output:

file.txt

OIEX19|BANG37748|DEL37728|WUBXDE|29-10-2000 10:10
AM|201209111625|29-10-1952 12:00 AM
SEETA7|CHA38228|DEL37728|DGSDFE|19-11-2012 07:05
PM|201308071912|29-10-1952 10:10 PM
PRIYS3|ANK37748|DEL37728|KEJRSRC|08-04-1960 09:10
AM|201407061815|29-10-1952 9:10 PM

How can I achieve it using awk?


Related to : how to convert date column of a file into user input format

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .