Checking that a list of three numbers are a subset of six
Posted on 2005-05-08
I have a txt file which contains lines of six numbers e.g 1,2,3,4,5,6. I have another file which contains lines of 3 numbers e.g 1,2,3. I would like to open the file with 6 numbers in, read a line then open my other file with 3 numbers in then check to see if any of the 3 numbers are within the line of six. Once this has checked the first line of six then goto the next line of six within the file and perform the same check. Once I have checked all of the lines of 6 in the file with my line of three I would then like to goto the next line of 3 numbers and perform the same check on all of the lines of six numbers on so on until I have looped thru all of the lines of 3 numbers. I would like to be able to create a spreadsheet/file with the results e.g there are 5 lines with 1,2,3. 10 lines with 456 etc. In addition, I would also like to be able to check for four matches , five matchs etc. This is for checking lottery tickets. I have VBA and have just started to use it thus my knowledge is limited. Any help appreciated!