I need to rename files generated automatically, truncating a timestamp at the end.
Files are named "abcd_efgh_jklm_21.04.2015.csv", with the numbers being today's date in german culture spelling and the "abcd"-parts one or more plain text parts. German culture uses . to separate the date parts, and that makes creating the rename instruction a problem (I think). Target name should be "abcd_efgh_jklm.csv" - remove last underscore and everything following it.
A real life example for a name could be
Here we have four word-parts, and the date part which should be zapped out. Result would be:
I read How does the Windows RENAME command interpret wildcards? and think I understood it mostly, but I cannot get it to work. Best I got is
ren *.csv *_.csv
creating "abcd_efgh_jklm_.csv". This is close, but I need to get the last underscore removed also. I cannot figure that out.