June 12, 201411 yr 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
June 12, 201411 yr 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.
June 12, 201411 yr 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
June 12, 201411 yr I was just about to suggest the exact same approach, but it's hard to be faster than comment … See here for a sample file with a script that uses this method. ExportByState_eos.fmp12.zip
June 13, 201411 yr Author Newbies I was just about to suggest the exact same approach, but it's hard to be faster than comment … See here for a sample file with a script that uses this method. Ok, so I realized I have FM Pro Adv version 9...
June 13, 201411 yr Ok, so I realized I have FM Pro Adv version 9... Too bad I didn't realize it … Try this one instead: ExportByState_eos.fp7.zip
Create an account or sign in to comment