|
Writing to Prism, text, HTML, XML or SQL tables |
|
|
Commands Table Prism [datatable number] <CLEAR> Table Text <&> <delimiter> Table CSV <’delimiter’> Table HTML <border #> <width #> Table XML [filename] Table SQL [datasource] <table > <login> <password> <CLEAR> WTable [column title] [row] [col] <subcol> WTable [column title] [text or %F or %N] NextRow EndTable OpenOutput [“filename”] ,<CLEAR>, <”delimiter”> Explanation These commands make it easy to export Prism results into structured tables. The first step is to define your table. You can write results right to a data table within Prism, to a text file (delimited with tabs), to a CSV (text file delimited with commas), to a HTML (web) table, to an XML table, or directly to a ODBC connected database. If you choose to write to a text, CSV or HTML file, create the file using the OpenOutput command before creating the table. This lets you combine other information (as explained in the next section) as well as the table. XML output must be in its own table, so enter its file name as part of the Table XML command. Use the WTable command to write a value into the table. The first argument will become the column title in the new table. The next three arguments define the cell on the current results (or data) table that will be written to the new table. Or enter text to just space columns apart, or %N to put in the loop number of %F to put in the current file name. In almost all cases, you’ll create a table as part of a loop. The Next statement that ends the loop also starts the next row on the table. When the loop is complete, so is the table. In rare circumstances, you might not want the end of a row to correspond with the Next statement of a loop. In this case, end a row with the NextRow statement, and close the table before the loop ends with the EndTable statement. |