Hello,
I would like to be able to rename hundreds of files within a directory with the following rules:
1) remove characters before the first - (hyphen) in the filename
2) remove the last 21 characters before the .xls at the end of the filename (removing more than 21 chars at end ok if needed to reduce final name length (w/o extension counted) to <= 31
3) the filenames don't have the same number of chars in the name
4) Some filenames would still have > 31 chars even after performing the truncations specified in 1) and 2) above. I
need to make sure each final filename <= 31 chars because I'm using Excel 2007 and I will be using these names as
sheet names.
I am open to whatever script language is best: windows batch file, VBA, powershell, etc.
Thank you for reading and any help you provide.
I would like to be able to rename hundreds of files within a directory with the following rules:
1) remove characters before the first - (hyphen) in the filename
2) remove the last 21 characters before the .xls at the end of the filename (removing more than 21 chars at end ok if needed to reduce final name length (w/o extension counted) to <= 31
3) the filenames don't have the same number of chars in the name
4) Some filenames would still have > 31 chars even after performing the truncations specified in 1) and 2) above. I
need to make sure each final filename <= 31 chars because I'm using Excel 2007 and I will be using these names as
sheet names.
I am open to whatever script language is best: windows batch file, VBA, powershell, etc.
Thank you for reading and any help you provide.