I know this has been covered many times, but i still can't seem to get a good solution to this particular aspect. I have the same problem in both bash and DOS. I have a file of many .csv files named abcYYMMDDf.csv and I want to change the file name to the YYMMDD part which corresponds to the date it was created. Note the "f" after the YYMMDD, so really i would like an equivalent of excel's mid() to take the middle date.
In bash I understand the rename function, and the * wildcard I tried variations on
rename abc*f.csv *.csv abc*
thinking that the * would stand in for YYMMDD but obviously it didn't. I saw another method involving selecting s/([a-z]*) but that would just take the whole file name surely?
In DOS I tried
ren abc*f.csv *.csv