 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
lilljimpa
Joined: 18 Apr 2007 Posts: 127
|
Posted: Tue Apr 28, 2009 1:39 pm Post subject: [solved] Finding missing number |
|
|
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: | 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 |
|
 |
Vifon
Joined: 22 Feb 2009 Posts: 47 Location: Poland
|
Posted: Tue Apr 28, 2009 1:56 pm Post subject: |
|
|
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 |
|
 |
MissingNo Guest
|
Posted: Tue Apr 28, 2009 2:04 pm Post subject: |
|
|
| 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
|
Posted: Tue Apr 28, 2009 2:17 pm Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|