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.

Read from text file then add to database

Featured Replies

Hi

I'm looking for advise. I need to read from an access log, get the result (which is tab-delimited text) and write each line as a separate record in a database.

It's a constantly changing file so it'd need to read from it constantly and retrieve any new entries

What's the best way to achieve this? PHP? Built-in FM function? 3rd party plugin? Is Filemaker the best way to do it, should I use PHP/MySQL instead?

If anyone has any advise/tips it'd be greatly appreciated

We need more info. Because you can import a tab-delimited, return-separated file into FileMaker with no problem. So one assumes there are other considerations. If you are concerned with overlap, and the file is not too large, you could import it into a temporary table (or file), then use a method to determine what was new.

If the file is large, and continually added to, yet sometimes dropping earlier entries (like many log files), then you might consider using more complex methods, using Mac command line tools, such as grep, and/or tail, to read only the last portion (which you didn't already have, write that to another text file, and import it.

You can run Mac command line via AppleScript (in a FileMaker Perform AppleScript step), or directly via the (free) plug-in zippShell. I tend to use AppleScript to run them, so I can also use regular AppleScript commands, variables, etc.. I'm not much of a Unix geek.

Is there a timestamp in each log line? That would certainly help.

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.