Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Exporting by "State" column to Seperate CSVs

Featured Replies

  • Newbies

Hi, I'm new to the boards and to Filemaker Pro, so please bear with me:

 

I have a giant list of contacts that is 180,000 rows, with columns such as name, address, company, state. The contacts are from all 50 states. I want to break down the giant list into 50 seperate lists, by U.S. state.

 

Right now I'm just doing a CTL+F under the "State" column and typing "CA" for example, then exporting the list of California contacts to CSV. It works, but is very time consuming.

 

Is there a way to make this faster? Maybe a script or macro I can create? I will be doing this every week, so trying to find an easier, more efficient solution.

 

Thanks and please let me know if I need to clarify anything!

 

--Andy

Of course you can script this. To make it easier, define a value list based on the State field in your table. Then have the script loop over the value list items, performing a find and an export for each in turn.

For example:

Set Variable [ $states; Value:ValueListItems ( Get ( FileName ) ; "States" ) ]
Loop
    Set Variable [ $i; Value:$i + 1 ]
    Exit Loop If [ $i > ValueCount ( $states ) ]
    Enter Find Mode [  ]
    Set Field [ YourTable::State; GetValue ( $states ; $i ) ]
    Perform Find [  ]
    Set Variable [ $filename; Value:GetValue ( $states ; $i ) & ".csv" ]
    Export Records [ File Name: “$filename” ]
End Loop

I was just about to suggest the exact same approach, but it's hard to be faster than comment …  :laugh:

 

See here for a sample file with a script that uses this method.

ExportByState_eos.fmp12.zip

  • Author
  • Newbies

I was just about to suggest the exact same approach, but it's hard to be faster than comment …  :laugh:

 

See here for a sample file with a script that uses this method.

 

Ok, so I realized I have FM Pro Adv version 9... :idot:

Ok, so I realized I have FM Pro Adv version 9... :idot:

 

Too bad I didn't realize it …  :turned:

 

Try this one instead:

ExportByState_eos.fp7.zip

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.