Hi all !
I have been asked to help find a solution for a project I’m working on. My objective is to read a number of text files containing rows of text with specific info in them.
eg. “name,adres,telephone number” You get the idea.
There are a lot of these rows in some of the text files. Over 500 000 rows per text file and just over 5000 text files to be exact. This number will grow next week. Anyway, my plan was to simply read these files and turn the data into a list.
My question is this:
Is it possible to find the first item (in this case"name") quickly without having to run a repeat loop like:
repeat with i in theList
if item 1 of i equals "whatever" then
set newList to i
end if
end repeat
The reason for this is because we will occassionally need to find specific data regarding the “name” entry. Almost like in a database. The text files are logs that are generated automatically by a third party and we need to streamline our workflow to deal with this old system.
The order of the items in the text file will always be the same.
Is there a better way? Perhaps a cocoa method. I’m still in the procces of learning applescript and I am not familiar with cocoa or how to implement it since I have to do this in my free time. i have written a small applescript studio app before but it’s relatively basic.
Thanks