au3scr Posted March 28, 2008 Share Posted March 28, 2008 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 Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Share Posted March 28, 2008 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. Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 Fow i do it i need list of files and then i need know how use list... do someone know any program for this? Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Share Posted March 28, 2008 I can do this within AutoIt, I just need more information, all the files on the desktop? All computer files? Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 (edited) lets take easy address C:\top_1000\file.mp3 or you can do desktop\top_1000 Edited March 28, 2008 by au3scr Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Share Posted March 28, 2008 (edited) lets take easy address C:\top_1000\file.mp3Thats 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 March 28, 2008 by R6V2 Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 FileListToArray() StringRegExpReplace() FileMove() Link to comment Share on other sites More sharing options...
Swift Posted March 28, 2008 Share Posted March 28, 2008 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! Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 (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 March 28, 2008 by au3scr Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 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) Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 Thank you fot these replyes, but do you know any existing program for this? I dont know how to make onescript from these tips Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 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 Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 (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 March 28, 2008 by au3scr Link to comment Share on other sites More sharing options...
DW1 Posted March 28, 2008 Share Posted March 28, 2008 why is this in chat??? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 why is this in chat???Not sure, it was in Example Scripts. Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 Works okay for me, maybe try: #include<file.au3> Dim $sourceFolder = @ScriptDir $Array = _FileListToArray($sourceFolder, "*.*", 1) For $i=1 To $Array[0] $result = StringRegExpReplace($Array[$i], "[^0-9a-zA-Z\.\-_]", "") FileMove($sourceFolder & "\" & $Array[$i], $sourceFolder & "\" & $result) Next Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 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? Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 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? Link to comment Share on other sites More sharing options...
DW1 Posted March 28, 2008 Share Posted March 28, 2008 Oh, OK that makes sense, just curious. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
au3scr Posted March 28, 2008 Author Share Posted March 28, 2008 (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 March 28, 2008 by au3scr Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now