I have a list of a few hundred files. They are currently as below:
filename.New_20160901.dat filename.New_20160902.dat ...
etc., all the way up to
I have a process that currently looks to pick files up from a landing directory, but in a totally different file name format.
What i want to do is rename the files but retain the date. For example, if i was to change one file it would be like:
$ mv filename.New_20160902.dat FILE_NAME_NEW.20160902.dat
Easily done for one file, but how can i do this for a list of files. I want to extract the date part of the old filename, store it as a variable and
mv that old file to a new file with the new filename, keeping the date part the same.