Re: Working with big lists
Re: Working with big lists
- Subject: Re: Working with big lists
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 22 May 2005 16:13:31 -0400
Note that uniq requires the file to be pre-sorted; all the "apples"
must be together, etc. If it's not, you can use sort to get it
that way:
set countInfo to do shell script "sort" & quoted form of (POSIX path of theFile) & " | uniq -c"
On 5/22/05, Daniel Jalkut <
email@hidden> wrote:Hi Rob - this output is almost identical in format to the results of the "uniq" shell tool.
Play around with the results of this script:
set
theResult to ""
set theFile to
choose file
set
theContents to every
paragraph of (do shell script "cat " &
quoted form of (POSIX path
of theFile))
set
countInfo to do shell script "uniq -c " &
quoted form of (POSIX path
of theFile)
The tool has been around so long I imagine it's probably pretty efficient.
Daniel
On May 22, 2005, at 11:58 AM, Rob Stott wrote:
I want to be able to read it and get;
apple 3
orange 2
pear 1
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (
--
Mark J. Reed <
email@hidden>
_______________________________________________
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