I need to extract dates (year,month,day) and times (hour,minutes) from a text file and use them later as variables. Not a homework, just trying to do something useful for my work. I am new to Linux.
INPUT: The text file contains list of files named like:
Desired output is:
2010 02 03 12 10
I'd like to put them separately into few variables: year, month, day, hour, minutes.
Should I use grep? Or sed? Or awk? Did a lot of reading, but feel stressed by amount of possibilities. Is it possible to write expression like "4 numbers after the string
S3G_MX_1_EFR____ is "year"? I don't need complete code, just need a bit of advice what options/commands to use or where to start.