Sender: |
|
Date: |
Thu, 19 Mar 2009 20:59:07 -0400 |
Reply-To: |
|
Subject: |
|
MIME-Version: |
1.0 |
Content-Transfer-Encoding: |
quoted-printable |
In-Reply-To: |
|
Content-Type: |
text/plain; charset=UTF-8 |
From: |
|
Parts/Attachments: |
|
|
Ed replied to a different thread on MacScript with an all-in-memory AS
solution that performs pretty well.. you just need the data to be in
the script.
On Thu, Mar 19, 2009 at 8:35 PM, Paul Berkowitz <[log in to unmask]> wrote:
> On 3/19/09 5:12 PM, "Mark J. Reed" <[log in to unmask]> wrote:
>
>> I would have used
>>
>> do shell script "sed -ne 's/^\\(..\\)" & zip & ".*$/\\1/p' zcta5.txt"
>>
>> but the principle is the same. You could also script TextEdit or
>> BBEdit... The variations I tried with pure AppleScript were
>> excruciatingly slow, but I might just be doing it wrong.
>
> I believe that Ed uses Excel. Ed, you could import a tab or comma-delimited
> text file, if that's what it is, into excel 9you can even script that, but
> you could just do it once in he UI and save the file as an .xls, and then
> script Excel to search for any zip code in the appropriate column and get
> the state code from its column in the same row. That would be fast, and
> scripting Excel's formula to do the same lookup would be even faster -
> instantaneous.
>
> Like Mark, I would counsel against trying to do a "pure" AppleScript parsing
> of the file, not using an application to do the heavy lifting: it will take
> forever.
>
> --
> Paul Berkowitz
>
--
Mark J. Reed <[log in to unmask]>
|
|
|