CONTEXT: I have a CSV file from which I want to extract and process some columns. I realized that AWK would be the perfect tool for this and everything went well until I had to deal with timestamps - for example 2008-07-31T21: 42: 52.667
PROBLEM 1: I need to calculate the number of days that have passed between a base date (say 2008-07-31 ) and all timestamps in the first column of the input file.
DETAIL: I know I can do differences operations if I can use BASH's date command, because with the following command I get the number of seconds passed since the date system base date:
date -d"2008-07-31" +%s #RESULTADO: 1217473200s
In this way my problem can be reduced to the following:
PROBLEM 2: How to execute a bash command from within AWK?