 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
artbasement
Joined: 01 Sep 2008 Posts: 56
|
Posted: Sun Sep 21, 2008 9:54 am Post subject: Compare Number but Ignore the Date |
|
|
I want to compare two txt files, one with a transaction number on the same line as the date like this....
| Quote: | 3417 21/09/2008
Test Item 1 5.00
_______
5.00
_______ |
and one with just the transaction number...
how can I make this code
| Code: | FileReadLine, transactionNum1, c:\sa\currslip.txt, 14 ; reads 14th line currslip.txt
FileReadLine, transactionNum2, c:\sa\num.txt, 1 ; reads 1st line of num.txt
If (transactionNum1!=transactionNum2)
msgbox Number NOT the Same |
Ignor the date on line 14? |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sun Sep 21, 2008 10:12 am Post subject: |
|
|
StringLeft
HTH
________________________________________________________
New here? Please, before you post...
1. Read the tutorial and try the examples. -> 2. Take a look at the command list to get an idea of what you could do. -> 3. Create your script. Consult the documentation and the FAQ if you get stuck. -> 4. Search the forum if you need help or examples, method 1 (forum), method 2 (site), method 3 (Google). -> 5. Post your code on the forum in the "Ask for Help" section if you still run into problems (but read this first). -> 6. There is more AHK on autohotkey.net and the Wiki and there is an AHK IRC chat. |
|
| Back to top |
|
 |
artbasement
Joined: 01 Sep 2008 Posts: 56
|
Posted: Sun Sep 21, 2008 10:50 am Post subject: |
|
|
| Sorry, can you give me an example of how to insert that? |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Sun Sep 21, 2008 11:15 am Post subject: |
|
|
| Code: | FileReadLine, transactionNum1, c:\sa\currslip.txt, 14 ; reads 14th line currslip.txt
FileReadLine, transactionNum2, c:\sa\num.txt, 1 ; reads 1st line of num.txt
StringLeft, transactionNum1, transactionNum1, 4 ; get the first 4 characters
If (transactionNum1!=transactionNum2)
msgbox Number NOT the Same |
________________________________________________________
New here? Please, before you post...
1. Read the tutorial and try the examples. -> 2. Take a look at the command list to get an idea of what you could do. -> 3. Create your script. Consult the documentation and the FAQ if you get stuck. -> 4. Search the forum if you need help or examples, method 1 (forum), method 2 (site), method 3 (Google). -> 5. Post your code on the forum in the "Ask for Help" section if you still run into problems (but read this first). -> 6. There is more AHK on autohotkey.net and the Wiki and there is an AHK IRC chat. |
|
| Back to top |
|
 |
Hasso
Joined: 23 Mar 2005 Posts: 321 Location: Germany
|
Posted: Mon Sep 22, 2008 11:20 am Post subject: |
|
|
Or use stringSplit with %A_SPACE% as delimiter if the transaction number vary in its number of digits. _________________ Hasso
Programmers don't die, they GOSUB without RETURN |
|
| 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
|