Shimgreen Posted September 2, 2008 Share Posted September 2, 2008 I got no clue on how to do this or even how to get started.I dont even know if autoit can do this but this is what i need help getting done with.I need to somehow be able to move all the files with numbers behind them into another directoryso all thats left when the files are done being moved is just the files with no number behind them.For Example. (please click to view full image to better understand) Link to comment Share on other sites More sharing options...
Dschingis Posted September 2, 2008 Share Posted September 2, 2008 (edited) Hi,i think the good old regular expressions may help in this case. try this one outCODE$file = "Blockhouse_5"; Now check whether or not its a file with _ and numberIf StringRegExp($file,"^.*_\d$",0) Then Msgbox(0,"Found","Moving file " & $file)EndIf$file = "Some_other_File_X"; Now check whether or not its a file with _ and numberIf Not StringRegExp($file,"^.*_\d$",0) Then Msgbox(0,"Found","Not moving file " & $file)EndIfThe regular expression "^.*_\d$" means:Check if my string has any characters (.*) from the beginning (^) and the last 2 chars are "_" and exactly one digit (\d) right before the end ($) of my string.the rest of your question can be solved with FileFindFirstFileRegards, Dschingis Edited September 2, 2008 by Dschingis Link to comment Share on other sites More sharing options...
Triblade Posted September 2, 2008 Share Posted September 2, 2008 Search the helpfile for: FileMove FileFindFirstFile StringRight or StringMid Begin with FileFindFirstFile() It't got a good example script with it which you may edit to your needs like FileMove the files when StringRight or StringMid detect a number. (Take notice that with StringRight fileextensions are seen. So, StringTrimLeft($file, StringLen($file) - 4) gives you the filename without a 3 letter extension with point.) My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) 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