Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse & Compare data in 2 files

Status
Not open for further replies.

hamboy1

Technical User
Jan 26, 2006
1
CA
Hi, I'm trying to write a vbscript to compare the data of two files, but I'm having trouble getting it to work ...



Basically, I open map.txt, parse and get the colored data, then open report.txt and look for the corresponding red text data and see if the other colors for that red text matches. if yes then good, if no, then i want to have the red text with the unmatching data outputed to a text file (unmatch.txt). example, P-ON0623, blue text is 27 in map.txt, however in report.txt the blue text is 49. this is considered an unmatch and unmatch.txt should have "P-ON0623" listed.



Also, if something in map.txt is not found in report.txt (such as P-ON0627) then list "P-ON0627" in a textfile called "notlisted.txt"



NOTE: the text files have no colors, they are just used to help explain my problem



ON137

map.txt

----------

"P-TOR-OMP-5:50" : "P-ON0626"
"P-TOR-OMP-3:51" : "P-ON0624"
"P-TOR-OMP-1:54" : "P-ON0628" # Modified on Tue Sep 30 12:06:37 EDT 2003
"P-TOR-OMP-3:48" : "P-ON0625"
"P-TOR-OMP-2:27" : "P-ON0623"
"P-TOR-OMP-3:52" : "P-ON0627" # Modified on Tue Sep 30 12:11:50 EDT 2003


report.txt

---------

"P-ON0625","BROCK/AYMER","TOR3_ECP","CELL 48"
"P-ON0626","HIGH/MARILAND","TOR5_ECP","CELL 50"
"P-ON0624","HWY 7/LANSDOWNE","TOR3_ECP","CELL 51"
"P-ON0137","PETERBOROUGH","TOR3_ECP","CELL 47"
"P-ON0623","PARKWAY/CRAWFORD","TOR2_ECP","CELL 49"
"P-ON0628","MILROY","TOR1_ECP","CELL 54"

 
When I have done this sort of thing, I put the data into some kind of database engine, even a primitive one: MS-Access, or even create DBase5 files via ODBC manager. Then this sort of matching logic can be done with sql Selects with 'Like' etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top