acana007 Posted February 13, 2010 Posted February 13, 2010 (edited) #include <file.au3> Dim $aRecords If _FileReadToArray("all.lst",$aRecords) < 8 Then _FileWriteFromArray("all3.lst",$aRecords) Exit EndIf this just copys the file but what i want it to do is only copy if the line has 8 or more characters Edited February 13, 2010 by acana007
dmob Posted February 13, 2010 Posted February 13, 2010 (edited) #include <file.au3> Dim $aRecords FileRead("all.lst") If @extended > 8 Then _FileWriteFromArray("all3.lst",$aRecords) EndIf Edited February 13, 2010 by dmob
PsaltyDS Posted February 13, 2010 Posted February 13, 2010 this just copys the file but what i want it to do is only copy if the line has 8 or more characters If you meant copy the whole file if it has 8 or more lines: #include <file.au3> Dim $aRecords _FileReadToArray("all.lst", $aRecords) If @error = 0 And $aRecords[0] >= 8 Then _FileWriteFromArray("all3.lst", $aRecords, 1) If you meant copy each line, if it has 8 or more characters: #include <file.au3> Dim $aRecords _FileReadToArray("all.lst", $aRecords) If @error = 0 Then For $n = 1 To $aRecords[0] If StringLen($aRecords[$n]) >= 8 Then FileWriteLine("all3.lst", $aRecords[$n]) Next EndIf Else explain what you really meant. 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
acana007 Posted February 17, 2010 Author Posted February 17, 2010 ok i want the script to copy the lines that are in that file that have 8 characters or more to the new file if it has less then 8 characters then skip them
JohnOne Posted February 17, 2010 Posted February 17, 2010 ok i want the script to copy the lines that are in that file that have 8 characters or more to the new file if it has less then 8 characters then skip themThen PsaltyDS' second example should be what you need. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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