RobinReumers Posted September 20, 2007 Posted September 20, 2007 Hi, Is there a way to import a txt file into one single field instead of breaking it up into multiple records? I'd like to import the whole content of one txt file into one field / variable! Any help would be appreciated! Robin
Fenton Posted September 20, 2007 Posted September 20, 2007 I can think of a couple of ways. A native FileMaker method would be to use the Import Folder step. It will import text files into a single field. But, of course, you'd have to put the single file into a folder first. Another slightly more difficult, but more convenient method would be to use AppleScript to read the file, then set it into a field. Or use a file plug-in. But that's really the same thing, for more money. This is an AppleScript that reads a chosen text file using the Unix "cat" command line. It creates a new record in the frontmost FileMaker window with the name and contents: global theName global theContents set theFile to choose file with prompt "Choose a text file" tell application "Finder" set theName to name of theFile set posFile to quoted form of POSIX path of theFile set theContents to do shell script "cat " & posFile -- converts Unix to Mac returns my FM_Create_Record() end tell on FM_Create_Record() tell application "FileMaker Pro Advanced" -- not needed in FileMaker tell window 1 set newRec to the ID of (create new record) go to record ID newRec set cell "Filename" of current record to theName set cell "Contents" of current record to theContents end tell end tell -- me neither end FM_Create_Record
RobinReumers Posted September 20, 2007 Author Posted September 20, 2007 Thanks a lot for the reply! As this application will also be running on a PC client (no Applescript), I think the easiest way is for me to do the import folder step and make sure taht just that file is in the folder! Robin
Recommended Posts
This topic is 6274 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 accountSign in
Already have an account? Sign in here.
Sign In Now