Jump 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.

Importing one Flat file -CSV into relational DB

Featured Replies

I ready to cry! I convinced the owners of my company to do online registration and now it's a mess!

Web designer sends me this file (forms.csv) and I need to get it in FMP file, I can't send it. And I don't know how to change it to the needed formate... I'm so ready to cry!

Is there a way to set the fields import, and how can I divide up the flat database to import into two files?

Gratefully,

Kim

forms.txt

It looks like you have a tab-delimited file. Is it only 1 file? What do you mean by "Page1", "Page2", etc.? Is that what's actually in the file? Is there actually a blank line between the sections? These things matter a great deal to someone parsing the file; we have to see exactly what you get (the exact format anyway, sample data is fine).

Are you processing this on a Mac? Because if so you could go through the file with AppleScript, and write each "section" to its own file. Then it's just 3 separate tab-delimted imports (or write the records directly with AppleScript, either way, not sure which is fastest, probably depends on the size of the files).

Otherwise you could import the whole file into a FileMaker field (likely global), then loop through the lines, setting each value into its proper table and field. You have the Child_id. You do not have a Parent_id. This is not a big problem in this case.

Are these always (always) new registrations? Or could one possibly conflict with an earlier record?

In any case it would be good to capture the name of the file, so you don't accidentally import one twice. Also fairly easy with AppleScript. Or you can use FileMaker Import's "Matching records" option, or, if looping, test for existing.

Hi Kim, don't cry yet. Try the following manual steps:

1) File>Open

2) in the Files Of Type dropdown select Tab Seperated Text Files (*.tab, *.txt)

3) Select your forms.txt file

4) in the First Row Option dialog box select the Data radio button & Click OK.

5) Name your new FileMaker file and click save

If you need further help in getting your file into a usable format see if the attached helps at all.

z_forms_Converted.zip

Also, you said "csv", but your file is tab-separated. If it is only one file then one simple import is not going to work, as the columns (fields) are not the same.

Here's a zipped excel file.

Download the file and unzip it.

Then in FM

Just click File>Import Records>file and map the fields. I broke down the spreadsheet in to Table 1, Table 2, Table 3. So match the tables to your current table and import. Check off "Do not import first record."

HTH

forms.zip

Also, you said "csv", but your file is tab-separated. If it is only one file then one simple import is not going to work, as the columns (fields) are not the same.

I'm not sure if that is directed at me or the original poster??? I too noticed the file was Tab seperated not COmma Separted and that is what I used in my example file.

The script I attached would find the Page2 records and export them to there own tab seperated file as attached. Since the file contains the column headings the new text file should be able to be mapped to the final Page2 data file(with first row contains field names).

Yes, it would require a few export files and more importing but it could all be scripted.

Page2.txt

Create an account or sign in to comment

Important Information

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

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.