thanks for the monster post... I enjoy the humor (and no i'm not a warden LOL). My data are actually locations of communication towers and each element ID (ie. P-*) is the ID assigned to a communication tower. basically map.txt is the data output of each communication tower from 1 system, and report.csv is output of the communication tower from another system. the objective was to compare the data from both systems to see if there are any discripancies.
After going through your monster posts, I can sort of make sense some parts, but I can't really get everything together. Your previous post (1/31/2006 8:39:34 AM) works perfectly for report.csv where it lists all of the data in a nice accessible format.
Were you able to do the same for map.csv? I assume it would be easier to work with since there's no "junk" data that needs to be ignored. Once the two files are in nicely accessible format, map.txt needs to be compared agaiinst report.csv for any discrepancies and output any differences of Cell/Reporting System using on Element ID as key to an "Unmatching" list. If Element ID from map.txt does not exist in report.csv, then it should be outputed to "Not found" list.
Is it possible to post the entire contents of each file in individual code tags so it's easier to make sense what's what?
< Message edited by hamboy -- 2/2/2006 4:35:49 AM >
thanks for the info! While I think about it, I propose that you look at Navarre's "file check" topic. It is about compareing data from two sources about the same items too, and I will post a demo using (RegExps and) dictionaries to find matching/missing/contradictory information. Perhaps you will feel more familiar with this approach. (Or you could post a small set of data from your domain showing the different cases you are interested in.)
the easy part first: That's my current set of source files:
(1) schema.ini: used by the ADO/Text driver; he/she/it (?) makes the files of one directory specified as DBQ in the connection string accessible as tables defined by the sections [<filename>] in schema.ini. You may add definitions to this file freely as long as you keep the filenames unique. Deleting/hiding sections by commenting out the [<filename>] section title, however, may break existing code.
(2) library.vbs: a set of functions/subs/classes that can be loaded into the namespace of a .vbs script by something like
Adding to this file is no problem; reworking existing code is not without danger (as old code using the library may break), but if you are carefull, old code may even profit from your changes.
(3) frstest.vbs: a main test script having three important parts:
The three parts together should allow you to use a (increasing) amount of tested code (library.vbs) to try something out (in the different main subs) while switching between them by reordering or [un]commenting the WScript.Ouit doThisOrThat() calls.
For some time it's a pro that you may refer to code you played around with yesterday when you search for better ways tomorrow. But it will become more of a con when the size of the file increases. So just start afresh with a minimal sectest.vbs
cool cool... it makes a lot more sense now... btw...what is sectest.vbs (your last posted code) for? it does not output anything
Just for clarification, example data: "P-MON-OMP-1:314" : "P-PQ0506", comparison is done with 4 things "MON", "1", "314", "P-PQ0506", which you have already done so it's cool.
however, when i ran the code it gave me error:
quote:
C:\vscript practice\commtower>cscript frstest.vbs Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. ##### Warden ehvbs doing his check ***** Who was/is sitting where? C:\Documents and Settings\mahkar\Desktop\test2\frstest.vbs(0, 1) Microsoft OLE D B Provider for ODBC Drivers: [Microsoft][ODBC Text Driver] The Microsoft Jet dat abase engine could not find the object 'prisoners_in_cells.csv'. Make sure the object exists and that you spell its name and the path name correctly.