TMaher1 Posted July 17, 2012 Posted July 17, 2012 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!
bcooney Posted July 17, 2012 Posted July 17, 2012 If each record needs to be a separate .tab file, then loop through the found set.
TMaher1 Posted July 18, 2012 Author Posted July 18, 2012 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????
No_access Posted July 18, 2012 Posted July 18, 2012 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 ))
TMaher1 Posted July 18, 2012 Author Posted July 18, 2012 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!
comment Posted July 18, 2012 Posted July 18, 2012 (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 July 18, 2012 by comment
TMaher1 Posted July 20, 2012 Author Posted July 20, 2012 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????????
comment Posted July 20, 2012 Posted July 20, 2012 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.
beverly Posted July 20, 2012 Posted July 20, 2012 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)?
comment Posted July 21, 2012 Posted July 21, 2012 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.
bcooney Posted July 21, 2012 Posted July 21, 2012 @TMaher1 I'd like to take back my first response. I'd rather ask you, "why?" Is this for import into another system?
TMaher1 Posted July 24, 2012 Author Posted July 24, 2012 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????????????
comment Posted July 24, 2012 Posted July 24, 2012 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?
TMaher1 Posted August 14, 2012 Author Posted August 14, 2012 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now