Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I need a script that will export multiple records to .tab files without me having to manually export each record.

How do I do this? Help!

Posted

If each record needs to be a separate .tab file, then loop through the found set.

Posted

Yes, I know that. I just don't how to write the script properly. I am not a programming genius. I tried writing a script, but it just put everything into one file.

Is there a basic script that will loop through a found set that I can modify????

Posted

Remeber Export Record will export the found set

set variable ($count;value:0)

loop

set variable ($count;value:$count +1)

perform find() /* value + count.. or record id.. you need to set up and Id on each record or a count....

export records($variable here)

end loop if($count > $count > Get ( TotalRecordCount ))

Posted

What do you mean by "you need to set up and Id on each record or a count..."?

I have two fields. TEAMID and PFACODE.

I want to output a file for each TEAMID that lists all the lines/records/rows (whatever you want to call them) of the PFACODE.

Also, how do I name each record using the TEAMID & .tab?

Ughhh!

Posted (edited)

This part is not quite clear:

I want to output a file for each TEAMID that lists all the lines/records/rows (whatever you want to call them) of the PFACODE.

If PFACODE is a field, then it cannot contain records. Perhaps you meant to say it contains multiple values - but if you export a single record in a tab format, the separate values in a field will NOT be tab-delimited.

---

Besides, if your field contains multiple values that need to be exported as separate lines/records/rows, you may want to re-examine your structure and turn them into separate records in a related table.

Edited by comment
Posted

Ok, yes, I meant values not records. Ok, if I turn them into related tables, then is there a script that will export them in the manner that want the to be exported??????????????

Posted

Well, there are two ways: first, even with your current structure you could export each record in turn by using the Export Field Contents [] script step, using a calculation field to substitute the returns with tabs. However, the resulting file will be UTF-16 encoded, and not all target applications can handle that.

The other option is to export as XML, using a custom XSLT stylesheet to build the exported file to your specifications.

Posted

export as XML (with XSLT) will not allow you to create multiple files upon output, if that's your goal.

Are you trying to get separate files (one per found record)?

Posted

export as XML (with XSLT) will not allow you to create multiple files upon output

No, of course not; you still have to loop through the found set and export each group of values in turn. I should have made that clear. Still, if your target application won't accept a UTF-16 encoded file, it's the only practical way to place tabs between the exported values.

Posted

@TMaher1

I'd like to take back my first response. I'd rather ask you, "why?" Is this for import into another system?

Posted

Because the PFACODE contains HTML code. I'm trying to create web pages for each find of TEAMID and all the PFACODE values related to TEAMID. No, I don't want to use FM server. Again, is their some script that can "automate" will repeat the export of each related record without me having to it manually one at a time??????????????????????????????

Posted

I have already mentioned two ways to do it. If you have said 'No, my target app cannot handle a UTF-16 encoded file" or "Yes, there is no problem with a UTF-16 file", we could concentrate on one of them.

PFACODE contains HTML code

Well, that's new. Why, then, is it important for the values to be tab-separated?

  • 3 weeks later...
Posted

I have already mentioned two ways to do it. If you have said 'No, my target app cannot handle a UTF-16 encoded file" or "Yes, there is no problem with a UTF-16 file", we could concentrate on one of them.

Well, that's new. Why, then, is it important for the values to be tab-separated?

Ok, I'll change the output to .html. Geesh.

This topic is 4482 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
×
×
  • Create New...

Important Information

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