AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[solved] Finding missing number

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
lilljimpa



Joined: 18 Apr 2007
Posts: 127

PostPosted: Tue Apr 28, 2009 1:39 pm    Post subject: [solved] Finding missing number Reply with quote

Hi

i have manges to sort a hole list with number from 1-16911
unfortunately there are some few numbers missing. It is 15241 lines in the txt file and i need to figure out how to find the missing numbers

ex:
Code:
1
2
4
5
6
9



Code:
FileRead, MyVar, number.txt ;first of i need to read the file

;handel the code

FileAppend, %missing%`n, missing.txt ;and appand the missing numbers to a text file


in this case it gona append
3
7
8

Edit: i figure it out by myself
_________________
you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)...


Last edited by lilljimpa on Tue Apr 28, 2009 4:38 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Vifon



Joined: 22 Feb 2009
Posts: 47
Location: Poland

PostPosted: Tue Apr 28, 2009 1:56 pm    Post subject: Reply with quote

It's not exactly what you want, but I would use something like this:
Code:
Loop FileRead, YourFile.txt
{
   if (A_Index := A_LoopReadLine)
   {
      MsgBox %A_Index% is missing
      Break
   }
}

After running it, you must fill the gap manually and restart this script.
Maybe someone else will have a better idea...
Back to top
View user's profile Send private message Visit poster's website
MissingNo
Guest





PostPosted: Tue Apr 28, 2009 2:04 pm    Post subject: Reply with quote

Code:
FileRead, Content, Existing.txt
Loop, Parse, Content, `n
{
   If (InStr(A_LoopField, A_Index) = false)
      MissingNo .= A_LoopField "`n"
   }
FileAppend, % MissingNo, Missing.txt
Not tested.
Back to top
lilljimpa



Joined: 18 Apr 2007
Posts: 127

PostPosted: Tue Apr 28, 2009 2:17 pm    Post subject: Reply with quote

MissingNo wrote:
Code:
FileRead, Content, Existing.txt
Loop, Parse, Content, `n
{
   If (InStr(A_LoopField, A_Index) = false)
      MissingNo .= A_LoopField "`n"
   }
FileAppend, % MissingNo, Missing.txt
Not tested.


hmm, that printed out exactly the same numbers that i had
_________________
you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group