I have a text file with date stamp and temperature values from five sensors and every ten minutes the file is updated with a new row of data.
Here is a sample of the data file - cols 1 and 2 are date and time, cols 3 to 7 are temperature values:
31-12 04:40 19.6 20.5 18.3 21.3 12.5
31-12 04:50 19.6 20.4 18.3 21.3 12.7
31-12 05:00 19.5 20.4 18.2 21.2 12.6
31-12 05:10 19.5 20.4 18.2 21.2 12.5
31-12 05:20 19.5 20.4 18.5 21.2 12.1
How can I use awk to extract from the data file those records that pertain to the last 24 hours, last 7 days, last 28 days and last 365 days?
See Question&Answers more detail:os