import hunderds of csv files into filemaker

Hi,

I’ve a little problem I can’t solve…

I’ve about a 1000 .csv files. (comma separated files)
I want those files in a databases using an Applescript.
But I can’t import a file to FileMaker.

Andre


tell application "Finder"
	set FolderLijst to choose folder
	set MijnLijst to every file of FolderLijst whose name contains "csv"
	
	tell application "FileMaker Pro"
	   	
              repeat with i from 1 to the count of MijnLijst
		     get name of item i of FolderLijst
	            -- do import? 
	        end repeat
	
      end tell
end tell

Do all your .csv files have the same field names and are they imported into the same fields in Filemaker.?

hi weedinner,

They have same fieldnames.

Andre

As far as I know you can’t pass a file reference to the filemaker import script. The csv files would have to converted to filemaker files before they could be imported via applescript (that can be done) but no point since if you have to do that you may as well use the import command and import each file seperately.

Sorry, no help

Andre SORRY

There is a way it can be done. I am having a discussion on another forum and I will be intouch

Hello andre and weedinner. I just posted some answers and an example file at http://www.fmforums.com
http://fmforums.com/forum/showtopic.php?tid/170652/post/179367/#179367/
You may have to register (free) for the link to work however.

The above method “reads” the files, then just creates new records with the data, one line at a time. I think it works fastest when you have numerous small csv files.

There are other methods, which involve stepping through the folder, renaming each file to a fixed name (which is pre-entered in a FileMaker Import step), then importing, renaming/move the file back again, then continuing.

Finally, in FileMaker 8 there is the ability to set a file path (in FileMaker syntax) into a Script Variable. This can then be used as an Import file reference, giving us (finally) a dynamic method within FileMaker.

So that’s 3 methods.