Hi All,
I ran into a stack overload issue while reading a large text file and found the solution of reading paragraphs of that file to eliminate the issue.
Before, I was holding all that data in one list called theReport which I’d then do binary searches on to find relative data. I can no longer do this since theReport is now a list of lists.
i came up with some code to un-nest the lists but its somewhat slow.
My question is this, is it faster to set up an itterative repeat loop to search for an item in a list of lists or should I continue un-nesting the list to do the binary search.
here is what my code looks like:
set thereport to paragraphs of (read file (ListToRead as text))
set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ","}
repeat with i from 1 to count of thereport
set item i of thereport to every text item of item i of thereport
end repeat
set AppleScript's text item delimiters to ASTID
set textitems to number of items in thereport
-- this segment of code un-nests the list and puts them back into csv data for the binary search
set csvdata to {}
set counter to 1
repeat textitems times
set counter2 to 1
set repitems to number of items in item counter of thereport
repeat repitems times
set end of csvdata to item counter2 of item counter of thereport
set counter2 to counter2 + 1
end repeat
set counter to counter + 1
end repeat
thanks for all the help
-Alex