I am working on an AWK script that parses millions of lines of text. Each line contains (among other things) a date and time in the form:
16-FEB-2008 14:17:59.994669
I need to convert this to the following form
20080216141759994669000
And I would like to avoid manually translating text from text to numerical value, if possible. In bash, I can simply execute the following command to get the desired result:
date -d "16-FEB-2008 14:17:59.994669" +"%Y%m%d%H%M%S%N"
I tried calling this command in AWK, but I cannot figure out how to do this. I'd like to know
- Can only be achieved with AWK?
- How can I use such a command in an AWK script file?
Thanks in advance
source
share