I have a very large file with more than 500,000 lines of dated events.
The first field contains the date/time in the following format:
20120727-files.files:20120727090044
where the first 8 numbers represent yyyymmdd. The last set of numbers represent yyyy/mm/dd/hh:mm:ss
I would like to change the value of the first field to:
YYYY-MM-DD HH:MM:SS
I have no clue how to do this. I started with displaying the first field only to simplify things.
awk -F"|" '{ print $1 }' infile
I've tried to find a cheatsheet for printf but couldn't find anything good. Is printf universal to many languages? Or is printf in bash unique to all....?
Thanks for reading..
-David