Sign in to follow this  
Followers 0
au3scr

Need help with mass rename

21 posts in this topic

How to rename 1000 files?

I want remove all other symols then

I want Allow only a..z A..Z 0..9 -_. in file names


Share this post


Link to post
Share on other sites



I don't know about Mass, but you would use FileMove() and that is a renamer.. :)

For a Mass FileMove() You would need a For/Next loop.

Share this post


Link to post
Share on other sites

Fow i do it i need list of files and then i need know how use list...

do someone know any program for this?


Share this post


Link to post
Share on other sites

I can do this within AutoIt, I just need more information, all the files on the desktop? All computer files?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

lets take easy address C:\top_1000\file.mp3

or you can do desktop\top_1000

Edited by au3scr

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

lets take easy address C:\top_1000\file.mp3

Thats not a mass rename, thats a 1 file rename............... :)

Still more information needed, what do you want to remove from these directory?

What do you want to rename..?

Edited by R6V2

Share this post


Link to post
Share on other sites

FileListToArray()

StringRegExpReplace()

FileMove()

Share this post


Link to post
Share on other sites

FileListToArray()

StringRegExpReplace()

FileMove()

Yep, I was tring to get what he wanted to remove..

$Array = _FileListToArray(@DesktopDir)
For $i=1 To $Array[0]
$1 = StringRegExpReplace($Array[$i])
FileMove($Array[$i], $1)
Next

Something like the code above!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

It was example i have 1000 files in top_1000

I want keep names but i want remowe bad symbols

I want remoe all symbols and keep only

a..z A..Z 0..9 -_.

Edited by au3scr

Share this post


Link to post
Share on other sites

It was example i have 1000 files in top_1000

I want keep names but i want remowe bad symbols

I want remoe all symbols and keep only

a..z A..Z 0..9 -_.

$fileName = "!@#@#$%#%#^file_#$%$%123-b.txt"

$result = StringRegExpReplace($fileName, "[^0-9a-zA-Z\.\-_]", "")

MsgBox(0,"",$result)

Share this post


Link to post
Share on other sites

Thank you fot these replyes, but do you know any existing program for this?

I dont know how to make onescript from these tips


Share this post


Link to post
Share on other sites

Thank you fot these replyes, but do you know any existing program for this?

I dont know how to make onescript from these tips

This is easy stuff, my grandma could do it. Don't forget this will strip spaces.

#include<file.au3>
$Array = _FileListToArray(@TempDir, "*.*", 1)
For $i=1 To $Array[0]
$result = StringRegExpReplace($Array[$i], "[^0-9a-zA-Z\.\-_]", "")
FileMove($Array[$i], $result)
Next

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

weaponx i tried ur scrpt i still hade these parts in file names B$h4?0w.mp3

Here is my modification of your script

#include<file.au3>

$Array = _FileListToArray("Z:\top1000", "*.*", 1)

For $i=1 To $Array[0]

$result = StringRegExpReplace($Array[$i], "[^0-9a-zA-Z\.\-_]", "")

FileMove($Array[$i], $result)

Next

Edited by au3scr

Share this post


Link to post
Share on other sites

why is this in chat???

Not sure, it was in Example Scripts.

Share this post


Link to post
Share on other sites

It was in example script beacause i didnt look where i am at posing and now it is in cheat beacause i asked if some one know program to do it?

but people didnt say me programes, people started to post theyr source here?


Share this post


Link to post
Share on other sites

It was in example script beacause i didnt look where i am at posing and now it is in cheat beacause i asked if some one know program to do it?

but people didnt say me programes, people started to post theyr source here?

Where are you from?

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

I have problem.

Windows dont allow rename them, i havi too bad symbols in file name

like $ and ? in file names so i need an other method to rename them.

DONE

I did it with krename under linux

NB! weaponx's source is perfect, tnx

Edited by au3scr

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0