At work I have to confirm data entered from a Word document matches what's built into a website. The problem is that they aren't in the exact same order. Another issue is that the way the Word document is set in table format, I can't just copy the numbers I need all at once since it grabs a bunch of other useless information. I've built a couple hotkeys that will copy the information from the website and save that as a variable, and then the second code will check if one highlighted item is in that variable. I'm wondering if there's a way for me to add multiple items to a variable (or maybe an array?) one by one from the Word document and then have the code compare all of those to the website saved variable and finally if any of them are missing, a message box would display any missing numbers.
Here's what I have so far.
Code: Select all
#p::
sendinput,^c
sleep,50
drugset:= clipboard
return
#i::
sendinput,^c
sleep,50
Haystack := drugset
Needle := clipboard
If InStr(Haystack, Needle)
MsgBox, Good to go
Else
Msgbox, No bueno
return
Here's an example of what is on the website when it gets copied
GPI
50280020001620
GPI
50250070102010
GPI
50250070102020
GPI
50280035102120
GPI
50280035102130
GPI
5025003500E420
GPI
50280050201620
A couple of things that crossed my mind were to create an array and then append the array with each new number from the Word document to that array. Then somehow loop through that and compare it to the drugset variable? Any suggestions/tips are greatly appreciated.
Thanks!