ffdshow Posted January 22, 2008 Share Posted January 22, 2008 Hi I have thousands of files in a folder which has spaces in names (e.g. help file 2.txt) Is possible to rename those files like this: helpfile2.txt Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 22, 2008 Share Posted January 22, 2008 HiI have thousands of files in a folder which has spaces in names (e.g. help file 2.txt)Is possible to rename those files like this: helpfile2.txtHI,_FileReadToArray and then FileMove with StringStripWS should help youMega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
weaponx Posted January 22, 2008 Share Posted January 22, 2008 HI,_FileReadToArray and then FileMove with StringStripWS should help youMegaCareful here. You want _FileListToArray, i'm sure this was an honest mistake. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 HiI have thousands of files in a folder which has spaces in names (e.g. help file 2.txt)Is possible to rename those files like this: helpfile2.txtAnother possibility is to just work with the 8.3 short names using FileGetShortName().Even better, upgrade your skilz and your scripts to be OK with names that names that have spaces in them. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ffdshow Posted January 22, 2008 Author Share Posted January 22, 2008 OK What is wrong in this script? #Include <File.au3> #Include <Array.au3> $path = @ScriptDir $dest = "C:\folder" $FileList = _FileListToArray($path, "*.txt") For $i=1 To UBound($FileList)-1 $name = StringStripWS($path & $FileList[$i], 8) FileMove($path & $FileList[$i], $dest & $FileList[$i] & $name,1) Next Link to comment Share on other sites More sharing options...
weaponx Posted January 22, 2008 Share Posted January 22, 2008 OK What is wrong in this script? #Include <File.au3> #Include <Array.au3> $path = @ScriptDir $dest = "C:\folder" $FileList = _FileListToArray($path, "*.txt") For $i=1 To UBound($FileList)-1 $name = StringStripWS($path & $FileList[$i], 8) FileMove($path & $FileList[$i], $dest & $FileList[$i] & $name,1) NextoÝ÷ Ûú®¢×µZ§ºÈ§X¥x¸¬µ:®¶²¶§ºfޮߢéÝ~)^²+)§v)ÞéÝ)¢«b Þy×èFèºwvb§yçZm§$²V¬·Á秶©jØZÛayø¥zv¦{v(¹Ú'ßÛpj{m¢)Üç^¶¨®("©_W§jg¢Ø^uë-véjØ_¢±bã(½æ®¶sb4æ6ÇVFRfÇC´fÆRæS2fwC°¢4æ6ÇVFRfÇC´'&æS2fwC° ¢b33c·FÒ67&DF ¢b33c¶FW7BÒgV÷C´3¢b3#¶föÆFW"gV÷C°¢b33c´fÆTÆ7BÒôfÆTÆ7EFô'&b33c·FÂgV÷C²¢çGBgV÷C² ¥ô'&F7Æb33c´fÆTÆ7B ¤f÷"b33c¶ÒFòb33c´fÆTÆ7E³Ð¢b33c¶æÖRÒ7G&æu7G&u2b33c·FfײgV÷C²b3#²gV÷C²fײb33c´fÆTÆ7E²b33c¶Ò¢fÆTÖ÷fRb33c·FfײgV÷C²b3#²gV÷C²fײb33c´fÆTÆ7E²b33c¶ÒÂb33c¶FW7BfײgV÷C²b3#²gV÷C²fײb33c¶æÖRäæW@ Link to comment Share on other sites More sharing options...
picaxe Posted January 22, 2008 Share Posted January 22, 2008 (edited) Try this (untested) #Include <File.au3> #Include <Array.au3> $path = "c:\util" $dest = "C:\folder" $FileList = _FileListToArray($path, "*.txt") For $i=1 To UBound($FileList)-1 $name = StringStripWS($FileList[$i], 8) FileMove($path & "\" & $FileList[$i], $dest & "\" & $name,1) Next too late Edited January 22, 2008 by picaxe Link to comment Share on other sites More sharing options...
ffdshow Posted January 22, 2008 Author Share Posted January 22, 2008 Try this (untested) #Include <File.au3> #Include <Array.au3> $path = "c:\util" $dest = "C:\folder" $FileList = _FileListToArray($path, "*.txt") For $i=1 To UBound($FileList)-1 $name = StringStripWS($FileList[$i], 8) FileMove($path & "\" & $FileList[$i], $dest & "\" & $name,1) Next too lateWorks! Thx! 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