Text file export

The Application Wizard generates a framework that exports all captured data to a text file in the application's export folder.

The default Export ruleset includes two rules:

  • Set Export Params: This rule is attached to the batch's Open element. It sets the export path and file name, and writes the header information to the file.
  • Export Page Fields: This rule is attached to each page and writes all fields values from the current page to the export file.

The resulting file looks like the following example, where each line represents one page and the fields are separated by commas.

*****************
Export for batch #20100334.019,12/01/2010,08:47:58  <--- Header information
,Tues, Dec 7, 2010,Boston (BOS),Fri, Dec 10, 2010,Boston (BOS),Compact,001,$345.70
,0,0,0,1
,Mon, Dec 6, 2010,San Francisco (SFO),Fri, Dec 10, 2010,San Francisco (SFO),SUV,010,$489.31
,Boston (BOS),Pittsburgh (PIT),17NOV10,Pittsburgh (PIT),Boston (BOS),21NOV10,313.17,64.56,477.73
,Newark, NJ (EWR),Charlotte, NC (CLT),MON NOV 15, 2010,Charlotte, NC (CLT),Newark, NJ (EWR),WED NOV 17, 2010,$524.76,$53.23,$577.99
,Dec 21, 2010,Dec 24, 2010,$293.03
,Nov 30, 2010,Dec 2, 2010,$243.07

The Export actions library includes actions that are typically used for exporting captured data to a text file. A few of the key export actions are outlined in the following table.

Library Action Description
Export SetExportPath Specifies the path to the export file's location. Typically you reference the export path in the application's configuration file by using the @APPPATH(export) smart parameter.
Export SetFileName Specifies the name for the export file (do not include the file extension).
Export SetExtensionName Specifies the extension for the export file.
Export SetExportFileEncodingAsASCII Specifies whether to export files in ANSI format. If you do not add this action, files are exported in Unicode format by default.
Export ExportAllFields Writes all field values on the current page to the export file.
Export ExportFieldValue Writes the specified field's value to the export file, for example,
ExportFieldValue(Return_Date)
.
Export CloseExportFile Closes the export file.