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

Comparing Two files

 [1/2] 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....

 [2/2] from: premshree::pillai::gmail::com at: 23-Feb-2005 12:20


Well, basically you'd need to treat each file as an array of lines. You'd need to do a array diff between the first with second array, and then the second array with the first. On Tue, 22 Feb 2005 14:50:54 -0800 (PST), martin <[mymarrandy--yahoo--com]> wrote:
> Hello. > I'm looking to separate data from Two files to provide
<<quoted lines omitted: 44>>
> To unsubscribe from the list, just send an email to rebol-request > at rebol.com with unsubscribe as the subject.
-- Premshree Pillai http://www.livejournal.com/users/premshree/

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted