• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to match data in two different text files as fast as possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to match data in two different text files as fast as possible?


  • Subject: How to match data in two different text files as fast as possible?
  • From: Richard Rönnbäck <email@hidden>
  • Date: Sat, 12 Aug 2006 08:38:42 +0200
  • Thread-topic: How to match data in two different text files as fast as possible?

I need to match data from two different text files, but none of the
techniques I know are fast enough, so I am hoping that someone will be able
to give me some good suggestions.


The first file I have consist of tabbed lines of data, like this:

 FilePaths  someData  someData2     someData3   moreColumns


The other file consist of tabbed lines with just:

FilePaths   UniqueID



In other words, the first file set is missing data that can be found (only)
in the second file.

What I need to do then is see whether each FilePath in the first file exist
in the second file and the append the corresponding UniqueID to the end of
that line. When all lines are processed the result should be written to a
file, so that I end up with:

FilePaths  someData  someData2     someData2   moreColumns  UniqueID



For lines that cannot be matched, the UniqeID field should either be empty
(just a tab stop) or better yet, say something like N/A. I should probably
also mention that the filePaths that should be matched may contain special
characters like (,.åäö,{  etc.

The problem is that both these files may contain anything from 1000 to 50000
lines and this makes every AppleScript technique I know much too slow and
the special characters is more  than my very limited knowledge of shell
tools can handle.

Please give me a helping hand with this


Thanks in advance

// Richard




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to match data in two different text files as fast as possible?
      • From: Emmanuel <email@hidden>
    • Re: How to match data in two different text files as fast as possible?
      • From: Takaaki Naganoya <email@hidden>
References: 
 >Re: How to 'wait' for an entourage schedule event to complete? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: How to 'wait' for an entourage schedule event to complete?
  • Next by Date: Re: INDESIGN CS2: Altering a Text Selection
  • Previous by thread: Re: How to 'wait' for an entourage schedule event to complete?
  • Next by thread: Re: How to match data in two different text files as fast as possible?
  • Index(es):
    • Date
    • Thread