How to do Mutiple file renaming

Closed
sunny - Oct 30, 2010 at 09:48 PM
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 - Nov 11, 2010 at 01:59 PM
Hello,

I want to rename contents of one folder(MS doc files) using the names of the images (gif)in a different folder. As the number of files are in thousands i find it very tough to do it manually. As the image names are not continuous am not able to use a bulk renaming software for the job. Is there a better way to copy the image name exactly and rename the doc ?

thanks in advance


Related:

2 responses

Blocked Profile
Oct 31, 2010 at 02:22 PM
Hi,

There is no such software, you will be compelled to do it manually.
0
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 14
Nov 11, 2010 at 01:59 PM
You would need to write a script.

Please provide more details. Meanwhile, here is a script for you.

# Script RenameDoc.txt
var str folder1, folder2, list1, list2, file1, file2, name
lf -n "*.gif" $folder1 > $list1
lf -n "*.doc" $folder2 > $list2
while ($list1 <> "")
do
 if ($list2 == "")
  break
 endif
 lex "1" $list1 > $file1
 lex "1" $list2 > $file2
 stex "^/^l]" $file1 > null ; stex "[^.^l" $file1 > $name
 system -s rename ("\""+$file2+"\"") (\""+$name+".doc\"")
done


This script is in biterscripting. It renames .doc files in folder2 the match the names of .gif files in folder1. Save the script in file C:/Scripts/RenameDoc.txt, start biterscripting, use this command

script "C:/Scripts/RenameDoc.txt" folder1("C:/test1") folder2("C:/test2")


Always use a lot of double quotes in scripting.
0