Jump to content

Importing Text File into Text Field - Impossible?


Recommended Posts

Hi,

all I need is to read the content of a text file into a text field and I can’t figure out how.

Situation: I have ≈150’000 folders, each with one image file and one xml/text file with meta information about the image file. The image file and the meta data need to go into the same record.

I’ve looked for hours now, but couldn’t find a solution:

• I can’t use the import folder command, because it creates new records for each file in a directory.

• I can’t use Do AppleScript > do shell script > cat x.txt, because I can’t get the result into FileMaker.

• I can’t use the new Read File script step of FM18, because the solution is on FM16 and FM17. (I tried it nevertheless, but all I got was the filename!?)

• I’cant use a plugin (MBS would work just fine, I think).

So, what are my options? Any ideas?

I would love to insert the xml file into a container and then read the container raw data — but how? A couple of years ago, I have read about someone actually doing this, but I can’t remember where or how. That would be cool!

Any other suggestions?

Thanks so much!

Gary

 

Link to post
Share on other sites

1. Why can't you use AppleScript or a plugin?

2. I haven't tested this, but if you import all the text files into one table and all the image files into another table (using import folder for both) there is a good chance they will be imported in the same order. Even if they are not, you can import the file path into a field in each table and use it to match up the records.

BTW, reading the text from a text file in a container field is possible in version 16 using the TextDecode() function. But I don't think you need to do this.

 

Link to post
Share on other sites

Comment, you’re a genius. I completely forgot about the TextDecode function. I really like it! So simple to use, works on any platform and even in my favorite FileMaker version (16).

AppleScript wasn’t really an option because I always get confused with the trazillion quote characters, the fact that it is not cross platform and especially the fact that there is no easy way to get the shell result back into FileMaker.

Shell support would be way cool. Maybe someone would write (has written?) a script that intelligently works cross platform (AppleScript/Shell & PowerShell) and that just delivers the shell output in a variable. That would be cool.

As for Plugins, I rather want to solve things without plugins: much less worries and maintenance.

Thanks again!

Gary

Link to post
Share on other sites

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
  • Similar Content

    • By 34South
      I can sense the eye rolls but, I’ve just upgraded to FMS19 on a MacPro after upgrading it to Big Sur and the database container fields are reporting missing files. I have defined the alternate database folder and its associated external storage volume which was verified. Could I have the syntax wrong? I have “filemac:/System/Volumes/External Data/Container Data/“.
      “External Data” is the name of my external drive. The “Volumes” folder is of course hidden but would that matter? I’ve tried unhiding it, but to no avail.
      Should one use “%20” in lieu of spaces? Should one use the sub folder “Container Data” in the path, or is that assumed anyway?
      I’ve tried these permutations but am getting nowhere. Does one need a restart after specifying the external container path - it didn’t seem to suggest so?
    • By Sinky
      Hi people! I hope someone can shed some light on the following issue.
      I made a simple script for button to import the data from .xlsx and update a field. Script works good but I have a problem with the last step. If xlsx contains the data for import, field gets updated and record is not shifted. Fine.
      However, if the .xlsx has no data to import, FM automatically shifts to the first record. What I would like is that in the latter case record is not shifted or in other words... I press the button, there is no import because there is no new data, current record is not shifted.
      I tried with Go to Record as the last step but none of the offered options (first, last, previous, next) does the job. I guess I should use calculation option but I'm completely clueless what to put in.
      Tnx in advance!!!

    • By stan111
      Gents, 
      there is a price list in Excel with images embedded. Do you have an idea how to import those records into DB with corresponding images preserved?
      Note that I've attached only two records, there are 600 of them. Any manual manipulations with the images is not an option.
       
      price.xlsx
    • By mountainx
      I am trying to import data from a MySQL database and need to somehow also import fieldnames to be the fieldname in FMP. Is there anyway to do that? I have a CSV of the fieldnames and I also have a MySQL dump of fieldnames and associated data.
      Thanks for any help.
    • By Answers
      Our people out in the field take photos which go directly into the container fields, we would like those photos to automatically transfer to the camera roll/gallery. I know there is an export command and that would allow the techs to export and choose the location, save image etc... But that is a tad too complicated for them.
      Any suggestions on how to automate this process, the script for export field contents doesn't have a choice to save to camera roll.
      Thank you!
      Caroline
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.