Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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

Posted

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.

Posted

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
  • Newbies
Posted

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:

This topic is 3816 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.