dreamscapeuk
Programmer
Hi,
I'm really new to vbscript need some help in writing the results from a validation of 2 txt files.
Both files are in the same format
5DigitAccountNo Space Value
e.g
40000 -190000.00
40100 2000.00
40200 50000.00
etc
I can do the basics like read each line in file one and match it with all the lines in file 2. If it exists move onto line 2 otherwise write in the resultsfile.txt. The problem with this is.. what if there is a line in file 2 that isn't in file one? that will not get reported unless i do another check the other way round. I'd like to tidy this process up.
What I want to do is compare both files and write any values that are different or the account doesn't exist in the each file.
So the results file is only produced if there are any differences and can look like this:
Account File 1 File 2
40000 -190000.00 In this case file 2 doesn't have an account 40000
40100 2000.00 In this case file 1 doesn't have an account 40100
40200 50000.00 42000.00 In this case values in both files are different.
I'm sure this has to be possible. I'm no vb programmer and taking examples around I have attempted to do this for hours but to no avail. If someone could help with a sample code I would really appreciate it.
I'm really new to vbscript need some help in writing the results from a validation of 2 txt files.
Both files are in the same format
5DigitAccountNo Space Value
e.g
40000 -190000.00
40100 2000.00
40200 50000.00
etc
I can do the basics like read each line in file one and match it with all the lines in file 2. If it exists move onto line 2 otherwise write in the resultsfile.txt. The problem with this is.. what if there is a line in file 2 that isn't in file one? that will not get reported unless i do another check the other way round. I'd like to tidy this process up.
What I want to do is compare both files and write any values that are different or the account doesn't exist in the each file.
So the results file is only produced if there are any differences and can look like this:
Account File 1 File 2
40000 -190000.00 In this case file 2 doesn't have an account 40000
40100 2000.00 In this case file 1 doesn't have an account 40100
40200 50000.00 42000.00 In this case values in both files are different.
I'm sure this has to be possible. I'm no vb programmer and taking examples around I have attempted to do this for hours but to no avail. If someone could help with a sample code I would really appreciate it.