[kwlug-disc] BASH compare items in two files

John Van Ostrand john at netdirect.ca
Wed Nov 3 14:17:00 EDT 2010


----- Original Message -----
> ----- Original Message -----
> > A higher level language (python, perl, C, etc) program would be your
> > best bet as they already have the XML parsing and data handling
> > libraries that will make this task a cinch.
> >
> > 1. Load the list of IDs into a searchable list
> > 2. Using a SAX parser compare the ID of every node against the list
> > 3. Done!
> 
> Oops I should read more carefully. He asked what a real programmer
> would do.

So my take on it is this. Use the document object model in some language. I presume that's what sax does. Javascript can do this (jQuery), as can the perl-XML-XPathEngine. I suspect php-domxml can as well. One uses a query language to search for the XML tags and iterates through them looking for matches or misses.

-- 
John Van Ostrand 
CTO, co-CEO 
Net Direct Inc. 
564 Weber St. N. Unit 12, Waterloo, ON N2L 5C6 
Ph: 866-883-1172 x5102 
Fx: 519-883-8533 

Linux Solutions / IBM Hardware 





More information about the kwlug-disc mailing list