by Stefan » Sat Feb 12, 2011 4:34 pm
You can use regular expressions for this issue.
RegEx(1)
Match: ^(\d{1,5})_(.+)$
Repla: \1 \2
Explanation:
^ => look from start of string
(\d{1,5}) => match one till five digits
_ => following by an underscore
(.+) => and the rest of string
$ => till string end
\1 => will replace the matched 1 till 5 digits
=> instead of the underscore we replace with an blank
\2 => will replace with the matched rest of the string
(\d{1,5})_ => match one till five digits following by an underscore
will only match and rename files which have one, two, three, four or five digits followed by an underscore at the begin like
123_456_789.TXT ---> 123 456_789.TXT
1244_56_789.TXT ---> 1244 56_789.TXT
12545_6_789.TXT ---> 12545_6_789.TXT
but not
125456_7_89.TXT ---> 12545_6_789.TXT
because that are not 5 digits following by an underscore but six digits.
HTH?