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 multiple text files in same folder

Featured Replies

Hi,

I have a multiple-file database solution originally developed in FMP3 and recently migrated to v7. I import tab-separated text files to get the data updated. The text files have variable numbers of records and originate on a Windows machine, which I download the data into and then save them to a ZIP file and then transfer them to the Mac for import into FMP7.

I was excited that the "import from a folder" option would allow me to put several text files which were to be imported into a single directory and allow a script to import all the records in all the files in that directory. After modifying my script to import a folder and specifying the import as text, it appeared to work at first glance. But upon checking, it only imported the first record in each file.

The end of line character is 0x0A in the text files. I have tried the "file origination option" as Mac, Windows, DOS and one of the unicodes all with the same results. It only imports the first record (line) of each file and ignores the remaining lines.

It would really save me alot of time if I could get this to work.

Thanks in advance,

Alex

Do the files import if you do them one at a time?

I believe it will work if you Import 1 as Tab-separated. FileMaker imports text as text, just as it is; which is good if that's what you're doing. But it recognizes returns as record separators if you choose Tab-separated or Comma-separated. I don't think it matters a whole heck of a lot whether it's Windows or Mac returns (at least on a Mac); I tried both settings; they both worked.

The obvious problem is then you have to do several Imports. You could use AppleScript to rename the files one at a time, Import, then rename them back. I've done this and it works. But perhaps a better way, especially if there are a lot of small text files, is to "concatenate" them with AppleScript into 1 text file, then import that.

This AppleScript in the attached file works for me; but YMMV.

TextConcImport7.zip

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.