variablefilenode Properties

The Variable File node reads data from free-field text files—that is, files whose records contain a constant number of fields but a varied number of characters. This node is also useful for files with fixed-length header text and certain types of annotations.

Example

node = stream.create("variablefile", "My node") 
node.setPropertyValue("full_filename", "$CLEO_DEMOS/DRUG1n")
node.setPropertyValue("read_field_names", True) 
node.setPropertyValue("delimit_other", True) 
node.setPropertyValue("other", ",")
node.setPropertyValue("quotes_1", "Discard") 
node.setPropertyValue("decimal_symbol", "Comma") 
node.setPropertyValue("invalid_char_mode", "Replace") 
node.setPropertyValue("invalid_char_replacement", "|")
node.setKeyedPropertyValue("use_custom_values", "Age", True) 
node.setKeyedPropertyValue("direction", "Age", "Input") 
node.setKeyedPropertyValue("type", "Age", "Range")
node.setKeyedPropertyValue("values", "Age", [1, 100])
Table 1. variablefilenode properties
variablefilenode properties Data type Property description
skip_header number Specifies the number of characters to ignore at the beginning of the first record.
num_fields_auto flag Determines the number of fields in each record automatically. Records must be terminated with a new-line character.
num_fields number Manually specifies the number of fields in each record.
delimit_space flag Specifies the character used to delimit field boundaries in the file.
delimit_tab flag  
delimit_new_line flag  
delimit_non_printing flag  
delimit_comma flag In cases where the comma is both the field delimiter and the decimal separator for streams, set delimit_other to true, and specify a comma as the delimiter by using the other property.
delimit_other flag Allows you to specify a custom delimiter using the other property.
other string Specifies the delimiter used when delimit_other is true.
decimal_symbol Default Comma Period Specifies the decimal separator used in the data source.
multi_blank flag Treats multiple adjacent blank delimiter characters as a single delimiter.
read_field_names flag Treats the first row in the data file as labels for the column.
strip_spaces None Left Right Both Discards leading and trailing spaces in strings on import.
invalid_char_mode Discard Replace Removes invalid characters (null, 0, or any character non-existent in current encoding) from the data input or replaces invalid characters with the specified one-character symbol.
invalid_char_replacement string  
break_case_by_newline flag Specifies that the line delimiter is the newline character.
lines_to_scan number Specifies how many lines to scan for specified data types.
auto_recognize_datetime flag Specifies whether dates or times are automatically identified in the source data.
quotes_1 Discard PairAndDiscard IncludeAsText Specifies how single quotation marks are treated upon import.
quotes_2 Discard PairAndDiscard IncludeAsText Specifies how double quotation marks are treated upon import.
full_filename string Full name of file to be read, including directory.
use_custom_values flag  
custom_storage Unknown String Integer Real Time Date Timestamp  
custom_date_format "DDMMYY" "MMDDYY" "YYMMDD" "YYYYMMDD" "YYYYDDD" DAY MONTH "DD-MM-YY" "DD-MM-YYYY" "MM-DD-YY" "MM-DD-YYYY" "DD-MON-YY" "DD-MON-YYYY" "YYYY-MM-DD" "DD.MM.YY" "DD.MM.YYYY" "MM.DD.YY" "MM.DD.YYYY" "DD.MON.YY" "DD.MON.YYYY" "DD/MM/YY" "DD/MM/YYYY" "MM/DD/YY" "MM/DD/YYYY" "DD/MON/YY" "DD/MON/YYYY" MON YYYY q Q YYYY ww WK YYYY Applicable only if a custom storage has been specified.
custom_time_format "HHMMSS" "HHMM" "MMSS" "HH:MM:SS" "HH:MM" "MM:SS" "(H)H:(M)M:(S)S" "(H)H:(M)M" "(M)M:(S)S" "HH.MM.SS" "HH.MM" "MM.SS" "(H)H.(M)M.(S)S" "(H)H.(M)M" "(M)M.(S)S" Applicable only if a custom storage has been specified.
custom_decimal_symbol field Applicable only if a custom storage has been specified.
encoding StreamDefault SystemDefault "UTF-8" Specifies the text-encoding method.