Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Comparing Two files

From: mymarrandy::yahoo::com at: 22-Feb-2005 14:50

Hello. I'm looking to separate data from Two files to provide the difference. Has anyone accomplished anything similar ? what would be the best way to do it ? Basically, The files are available as CSV and/or tab delimited Data in One is:- Field One = ID Field Two = First Name Field Three Last Name Field Four = Email address Field Five another code 0123456 John Williams [jon--williams--aol--com] vsyter5793 I have second list with a format of :- Field One = First Name Field Two = Last Name Field Three = Email address John Williams [jon--williams--aol--com] The order is different, and there may be more or less entries in either One. I would like to compare the First files Field Four (email address) against the Second files Field Three (email address). If there is a match, export the file One's entire line to a new file, Three. If there is NO match, I would like to export the entire line to new file, Four ie. a) email addresses in file One that are in file two, export the whole line from file One to file Three. b) email addresses in file One that are NOT in file Two, export the whole line from file One to file Four. c) email addresses in file Two that are not in file One, export the whole line from file Two to file Four. This should give :- 1) A new File Three with email addresses in both files but with Five fields. 2) A new file Four with email addresses NOT in either file, some with 3 fields, some with 5 fields. I suppose it would be nice to adjust the part c) so they moved to the correct field location. Any clue's, ideas, code, pointers. Regards....