How to match data in two different text files as fast as possible?
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