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

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

Recommended Posts

  • Newbies
Posted

I need to import records from csv files generated by another application. My problem is that the filename changes daily. I can create the target filename and path easily using a field and functions, but import or file open don't seem to have a way of picking up the target filename from that field.

I've probably missed something obvious, but does anyone have a suggestion ?

Posted

FileMaker only imports from a fixed file and location, which must be set up in an Import script step. So, the technique, if you want to automate this, is to use another tool, such as AppleScript, to:

1. take the file you want to import,

2. move/rename it to the fixed FileMaker import file

3. Import it

4. move/rename it back (optionally to a "Done" folder)

You need an original "dummy" csv file, with the fields (columns) needed, to set up the fixed Import step. But then that file can be moved/deleted. The new file(s) become that file during the import.

I have some examples for doing this, but they are for importing ALL the files in an "Import" folder, hence they're in a Loop. Also they're in FileMaker 7. I decided to dump my FileMaker 5-6 examples (housekeeping). So the attached example has a version 7 database. But the AppleScripts themselves are included as source files (though they are in FileMaker Perform AppleScript steps in the file).

I do have an Import Excel example in 5-6, if you need it. The routines are the same, but the Import step is set up slightly different. It was kind of a pain to set up (and especially to modify) imports in 6 compared to 7.

[There is actually an alternative method to do csv imports with AppleScript. Which is to read/parse the file's contents in AppleScript itself and set the FileMaker fields from there. It's quicker for small files. But a bit geeky, and not much tested :-]

Import_wFM.zip

  • Newbies
Posted

Hi Fenton

Thanks for the reply. It has saved me wasting a lot of time trying to do something FM can't do.

I've worked around by creating an intermediate FM file which two FM files now use. There is a minute chance of losing a couple of records - the external application, over which I've no control, switches files around at exactly midnight - but I can live with this for the time being.

Many regards

Noel Welpton

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