cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

how to publish to excel in arbortext editor 6.0?

lhuang
1-Newbie

how to publish to excel in arbortext editor 6.0?

In arbortext editor 6.0,how to publish document to excel file ?

1 ACCEPTED SOLUTION

Accepted Solutions

You can use a FOSI stylesheet to generate a comma-separated file from a structured markup document.

First, set the file extension for FOSI-exported files to ".csv" with the APTEXPORTEXT system variable.

Second, code e-i-cs that save the desired content, commas, and record ends to an appended string and write the result to an external ASCII file.

For example, assuming the content is in table cells, the following e-i-cs will generate a comma-separated file in the document directory when the document is formatted:

<e-i-c gi="entry" context="* table" occur="notlast">

<charlist inherit="1">

<savetext textid="csv.app" conrule="#CONTENT,\,\" append="1">

</charlist>

</e-i-c>

<e-i-c gi="entry" context="* table" occur="last">

<charlist inherit="1">

<savetext textid="csv.app" conrule="#CONTENT,\&#RE;\" append="1">

</charlist>

</e-i-c>

<e-i-c gi="generated">

<charlist inherit="1">

<usetext source="csv.app" userule="1"></usetext>

</charlist>

</e-i-c>

<e-i-c gi="table">

<charlist inherit="1">

<usetext source="<generated>,</generated>" placemnt="after"></usetext>

</charlist>

</e-i-c>

The resulting file will be named generated.csv. To change the file name, change the three instances of "generated" to the desired name.

I've attached a bare-bones FOSI with the above e-i-cs, which can be used as a template. If the desired content is not in table cells, then element names, contexts, and occurrences can be modified as needed.

For example, if the desired content is in markup such as this:

     <partlist><part><partno>...</partno><partdesc>...</partdesc></part>...</partlist>

the following changes would be needed:

     gi="entry" context="* table" occur="notlast" becomes gi="partno" context="part partlist" occur="all"

     gi="entry" context="* table" occur="last" becomes  gi="partdesc" context="part partlist" occur="all"

     gi="table" becomes gi="partlist"

To generate the .csv file, put the cvs.fos file in the same directory as the document, then enter the following at the command line:

      set fosi=csv; format

BTW: More than one e-i-c can write an external file.

Hope this heps! Please let me know any questions you may have.

Suzanne Napoleon

www.FOSIexpert.com

"WYSIWYG is last-century technology!"

View solution in original post

3 REPLIES 3

Are you wanting to create a comma separated list?

What do you mean by publish? Are you meaning certain tags fill certain fields?

There is no option to publish to Excel. You can use File > Publish to Web, HTML, HTMLHelp, RTF, Printer, PDF

You may be able to use an XSL style sheet to transform a document to an Excel readable file.

You may also use ACL to write to a file, and as such create a comma separated list that is readable by Excel.

You can use a FOSI stylesheet to generate a comma-separated file from a structured markup document.

First, set the file extension for FOSI-exported files to ".csv" with the APTEXPORTEXT system variable.

Second, code e-i-cs that save the desired content, commas, and record ends to an appended string and write the result to an external ASCII file.

For example, assuming the content is in table cells, the following e-i-cs will generate a comma-separated file in the document directory when the document is formatted:

<e-i-c gi="entry" context="* table" occur="notlast">

<charlist inherit="1">

<savetext textid="csv.app" conrule="#CONTENT,\,\" append="1">

</charlist>

</e-i-c>

<e-i-c gi="entry" context="* table" occur="last">

<charlist inherit="1">

<savetext textid="csv.app" conrule="#CONTENT,\&#RE;\" append="1">

</charlist>

</e-i-c>

<e-i-c gi="generated">

<charlist inherit="1">

<usetext source="csv.app" userule="1"></usetext>

</charlist>

</e-i-c>

<e-i-c gi="table">

<charlist inherit="1">

<usetext source="<generated>,</generated>" placemnt="after"></usetext>

</charlist>

</e-i-c>

The resulting file will be named generated.csv. To change the file name, change the three instances of "generated" to the desired name.

I've attached a bare-bones FOSI with the above e-i-cs, which can be used as a template. If the desired content is not in table cells, then element names, contexts, and occurrences can be modified as needed.

For example, if the desired content is in markup such as this:

     <partlist><part><partno>...</partno><partdesc>...</partdesc></part>...</partlist>

the following changes would be needed:

     gi="entry" context="* table" occur="notlast" becomes gi="partno" context="part partlist" occur="all"

     gi="entry" context="* table" occur="last" becomes  gi="partdesc" context="part partlist" occur="all"

     gi="table" becomes gi="partlist"

To generate the .csv file, put the cvs.fos file in the same directory as the document, then enter the following at the command line:

      set fosi=csv; format

BTW: More than one e-i-c can write an external file.

Hope this heps! Please let me know any questions you may have.

Suzanne Napoleon

www.FOSIexpert.com

"WYSIWYG is last-century technology!"

rdiaz
5-Regular Member
(To:lhuang)

Hi Li,

Did Suzanne's reply help you resolve the situation?  Let us know if you need more assistance.

Otherwise, feel free to mark Suzanne's response as 'Correct'

Thanks!

Top Tags