I'm looking for a command or a simple procedure to get the date from the filename. My file name could have multiple date formats.
Eg:
Filename Format Output filename_2016-01-01 filename_%Y-%m-%d 2016-01-01 2016-01-01_filename %Y-%m-%d_filename 2016-01-01 20160101-filename %Y%m%d_filename 2016-01-01 1451606400-filename %s-filename 2016-01-01 I'm looking for some procedure say if I specify my "Format" it will return date from that format as output. I'm not worried about format of output. I'm not expecting a huge script. Please let me know if any such functionality already exists.
If there is not other procedure, I'm planning to build one.