Friday, June 21, 2013

Text File Output

The Text File Output step is used to export data to text file format. This is commonly used to generate Comma Separated Values (CSV files) that can be read by spreadsheet applications. It is also possible to generate fixed width files by setting lengths on the fields in the fields tab.

File Tab

The options under the File tab is where you define basic properties about the file being created, such as:
OptionDescription
Step name Optionally, you can change the name of this step to fit your needs.
Filename Specify the CSV file from which to write
Run this as a command instead? Enable to "pipe" the results into the command or script you specify
Accept file name from field? Enable to specify the file name(s) in a field in the input stream
File name fieldWhen the previous option is enabled, you can specify the field that will contain the filename(s) at runtime.
ExtensionAdds a point and the extension to the end of the file name. (.txt)
Include stepnr in filenameIf you run the step in multiple copies (Launching several copies of a step), the copy number is included in the file name, before the extension. (_0).
Include partition nr in file name? Includes the data partition number in the file name
Include date in file nameIncludes the system date in the filename (_20101231)
Include time in file name Includes the system time in the filename (_235959)
Show file name(s) Displays a list of the files that will be generated
Note: This is a simulation and depends on the number of rows that will go into each file.

Content tab

The content tab contains the following options for describing the content being read:
OptionDescription
AppendEnable to append lines to the end of the specified file
SeparatorSpecify the character that separates the fields in a single line of text; typically this is semicolon (;) or a tab
EnclosureA pair of strings can enclose some fields. This allows separator characters in fields. The enclosure string is optional.
Force the enclosure around fields?Forces all field names to be enclosed with the character specified in the Enclosure property above
HeaderEnable this option if you want the text file to have a header row (first line in the file)
FooterEnable this option if you want the text file to have a footer row (last line in the file)
FormatCan be either DOS or UNIX; UNIX files have lines are separated by line feeds, DOS files have lines separated by carriage returns and line feeds
CompressionSpecify the type of compression, .zip or .gzip to use when compressing the output.
Note: Only one file is placed in a single archive.
EncodingSpecify the text file encoding to use. Leave blank to use the default encoding on your system. To use Unicode, specify UTF-8 or UTF-16. On first use, Spoon searches your system for available encodings.
Fast data dump (no formatting) Improves the performance when dumping large amounts of data to a text file by not including any formatting information
Right pad fields Enable so that fields are padded to their defined width on the right
Split every ... rows If the number N is larger than zero, split the resulting text-file into multiple parts of N rows
Add Ending line of file Allows you to specify an alternate ending row to the output file

Fields tab

The fields tab is where you define properties for the fields being exported. The table below describes each of the options for configuring the field properties:
OptionDescription
NameThe name of the field
TypeType of the field can be either String, Date or Number.
FormatThe format mask to convert with. See Number Formats for a complete description of format symbols.
LengthThe length option depends on the field type follows:
  • Number - Total number of significant figures in a number
  • String - total length of string
  • Date - length of printed output of the string (for exampl, 4 returns year)
PrecisionThe precision option depends on the field type as follows:
  • Number - Number of floating point digits
  • String - unused
  • Date - unused
CurrencySymbol used to represent currencies like $10,000.00 or E5.000,00
DecimalA decimal point can be a "." (10,000.00) or "," (5.000,00)
GroupA grouping can be a "," (10,000.00) or "." (5.000,00)
Trim typeType trim this field (left, right, both) before processing
Note: Trimming works when there is no field length given only.
NullIf the value of the field is null, insert this string into the text file
GetClick to retrieve the list of fields from the input fields stream(s)
Minimal widthChange the options in the Fields tab in such a way that the resulting width of lines in the text file is minimal. So instead of save 0000001, you write 1, and so on. String fields will no longer be padded to their specified length.

3 comments:

  1. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    ReplyDelete
  2. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    ReplyDelete
  3. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    ReplyDelete