i want to rename files a1.txt, a2.txt ...aN.txt files to a1-v1.xt ...aN-vN.txt .
This bitescript will do it. I will assume your files are in folder C:\folder.
# Change dir to C:\folder.
# Get a list of files a*.txt.
var str list ; lf -n "a*.txt" > $list
# Process files one by one.
while ($list <> "")
# Get the next file in the list.
var str file ; lex "1" $list > $file
# Get the sequence number. It is between a and .txt
var str seq ; stex -p -r -c "^a&\.txt^" $file > $seq ; stex -c "^a^]" $seq > null ; stex -c "[^.txt^" $seq > null
# New file name is a$seq-v$seq.txt
var str newname ; set $newname = "a"+$seq+"-v"+$seq+".txt"
# Rename file
echo -e "Renaming file " $file " to " $newname
system rename ("\""+$file+"\"") ("\""+$newname+"\"")
Save the script as C:\Scripts\rename.txt. Start biterscripting. Enter the following command.
That's it. Donwload biterscripting if necessary from http://www.biterscripting.com . It is free. Don't forget to change C:\folder in the script to the correct folder path.