Jump to content

How do I export one file per record?


ManyBirds
 Share

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

Recommended Posts

  • Newbies

Would upgrading to FM 8 help me, given its support for file names in a variable? I need to export multiple files in one fell swoop from one database. I have a field containing the data to be put into each file. And I have a field containg the name for each file. I want to export one file for each record, and perform this for all of my selected records. That's all. Many uses for this, for example, for creating an html page to accompany each photo in a collection. Or creating a projection file to accompany each aerial photo. Thanks

Link to comment
Share on other sites

Hi ManyBirds,

A fairly simple looping script should do it.

Using a simple example, say you have two fields in a database called ‘exportfile’, one is a container field called ‘Image’ to hold the images and one is text field called ImageID to identify what the image is (could be a simple ID or the name of the image or whatever).

Find the records you want to export and run a script something like:

Set Error Capture (on)

Allow User Abort (on)

Go to record/request/page [first]

Loop

Set Variable [$Filename; Value:exportfile::ImageID

Export Field Contents [exportfile::Image; “$Filename”]

Go to record/request/page [Next; Exit after last]

End loop

Remember that on the ‘Export Field Contents’ step you will have two options to select in the dialogue box. The Specify Target Field box (where you select what field it is that is holding your images) and ‘Specify Target File’ where you specify the file path to the folder where you want the images exported to. (You can add a path by just clicking on the ‘Add file…’ button then add your ‘/$Filename’ variable to the end of it.

Trust this may help.

Highbury

Link to comment
Share on other sites

Sorry, one thing I forgot. When you set the variable then add whatever the image format is to the end of it, e.g if it's a jpeg then the variable should read

exportfile::ImageID & ".jpeg"

This will make sure that whatever you choose to open the image will recognise what format it is.

Link to comment
Share on other sites

This topic is 5717 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
 Share

×
×
  • Create New...

Important Information

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