Jump to content

Exporting each record to separate file


Kevin G B
 Share

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

Recommended Posts

I'm trying to create a script that will export each record in the database to a separate text file. I need to create an individual HTML file for each record in the database (I've stored HTML tags in global fields). I cannot seem to figure out a way to logically do this in the script. I thought the Omit Record/Show Omitted commands were the answer, but I can't figure out a way to then continue looping through the records in the correct order. Any suggestions?

Link to comment
Share on other sites

Personally, I think an easier/faster way would be a simple loop script that uses a file plugin (www.troi.com or www.geocities.com/SiliconValley/Network/9327/)

However, the way I would do this without a plugin would be:

Once you have your found set of records, freeze window, go to a layout that only has one field on it, a field that contains a relation key that uniquely ids the record.

Do a copy all records step and put the result in a global field (lets call it "found records").

You have a global in the loop that represents which loop number/record you are on. So the first loop it contains "1" the second loop it contains "2" etc.... Lets call it "loop number".

Now, inside the loop, set a global field "nowOnThisRecord" = to MiddleWords(found records, loop number, 1). You should have a relationship from nowOnThisRecord to the field that was on the copy all records layout. Inside the loop, do a "Go To Related Records" based on that relation.

Then export, and continue the loop from the top.

Once you are done, you can even do a go to related record based on a relation from "found records" to that field that was on the copy all records layout. To restore the found set to it's original.

Hope this helps!

-Dave

Link to comment
Share on other sites

Remember: global fields can only store 32k text. If You're working with tables and font tags, You'll run out quite fast!

I made a similar solution, but used Troi's file plug in, where You can sequently export in one text file without any limits.

have fun

Link to comment
Share on other sites

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