Jump to content

Shell script get top N values in a field


This topic is 7226 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Filemaker fun with unixy stuff for Mac OSX - get the top N values in any field in any database. Put the following in perform applescript step in a FileMaker script:

choose from list (get name of every field)

set whichfield to item 1 of result

set theData to field whichfield of document 1

set AppleScript's text item delimiters to ASCII character 10

Set shellStuff to " | sort | uniq -c | sort -rn | head -5"

do shell script "echo " & quoted form of (theData as text) & shellstuff

display dialog result

SaleData.zip

Link to comment
Share on other sites

This topic is 7226 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.