Read Variable-Length File

Operation Name

Read Variable-Length File

Function overview

Read variable-length file.

Data model

Data model of this type of component is table model type.

Properties

For information about using variables, refer to "variables".
Basic settings
Item name Required / Optional Use of Variables Description Remarks
Name Required Not available Enter the name on the script canvas.  
Required settings
Item name Required / Optional Use of Variables Description Remarks
File Required Available Enter the file path to read variable-length.

Click [Browse] button to activate the file Selectr and Select the file.
Delimiter mode Required Not available Select how to specify the delimiter.
  • [Select from list]: (Default)
    Select delimiter character from the list.
  • [Enter directly]:
    Input the delimiter character directly into the field.
  • [Enter character code]:
    Input delimiter character into field with character code.
  • Specified by the method selected, the corresponding input fields ([Delimiter list] / [Delimiter]) switches.
Delimiter list Optional Not available Select a delimiter character.
  • [Space]: (default)
  • [TAB] (Tab):
  • [Comma]:
  • [Semicolon]:
  • [Slash]:
  • [New line]:
  • Enables when you select [Delimiter mode] from [Select from list].
Delimiter Optional Available Enter a delimiter character.
  • [Enter directly] case
    Directly input from the keyboard.
  • [Enter character code] case
    [Encoding] type of encoding specified in bytes.

    Octal (prefix "0" <zero digit>), decimal (no prefix), hexadecimal (prefix "0x" <X of the alphabet and the number zero> or "#") input is available .
    If padding is composed of multiple bytes, input with being separated by commas.Ex.: 0x10, 0x13
  • Enables when [Enter character code] or [Enter directly] are selected in [Delimiter mode].
Double quote escape Required Not available Select whether to make the double quote escape.
  • [Disable]: (default)
    No double-quote escape.
    Delimiter can not be held as field value.Delimiter can not be held as field value.
  • [Enable]:
    Perform double-quote escape.
    The field delimiter, if contains quotes or double quotes around field values.
    Double quotes if it contains a field value represented by two letter quotes a letter quotation marks.
  • Across the field in double quotes, double quotes, or if there is no delimiter in the field you want to escape is an error.
Format Required Not available Select a file format definition that is variable with global resources.
How to set the "Variable Wizard" Please for more information.
  • [Add]:
    Adds new global resource.
  • [Edit]:
    Global resource settings can be edited with "Edit Resource list".
 
Property Action
Item name Description Remarks
Preview Start the previewer, display the contents of the file specified in [File].
  • Disables when specified file dose not exist, or variables are set in [File].
  • Encode specified in [Encoding] is displayed.
  • You can not edit the file contents.
  • Files with file size smaller than 1MB can be displayed in previewer.If the file size exceeds 1MB, 1MB size contents from the beginning of the file are displayed.
Read settings
Item name Required / Optional Use of Variables Description Remarks
Encoding Required Available Select or input read file encode.

Use only the canonical name supported by Java SE Runtime Environment 8 when specifying the encoding directly in the field.
Refer to "Supported Encodings"(http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) for details.
  • For information regarding the default values used, refer to "Default encoding".
New line code Required Not available Select a new line code.
  • [AUTO]: (default)
    Implementation-dependent
  • [CR]:
    Primarily Mac OS (Version 9)
  • [LF]:
    Primarily UNIX/Linux
  • [CR+LF]:
    Primarily Microsoft Windows
 
Retrieve empty fields as empty string Optional Not available Select whether to retrieve the value of the field as an empty string or as null if the field is empty.
  • [Checked]:
    Retrieved as empty string
  • [Not Checked]:(default)
    Retrieved as null
 
Mass data processing
Item name Required / Optional Use of Variables Description Remarks
Mass data processing Required Not available Select a data processing method.
  • [Use script settings]: (default)
    Use adapter to set script properties of the data process.
  • [Disable]:
    Mass data processing is not performed.
  • [Enable]:
    Mass data processing is performed.
 
Comment
Item name Required / Optional Use of Variables Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

Schema

Input Schema

None.

Output Schema

The number of columns varies depending on the [Format]
See "Schema of Table Model" for details regarding schema structure.

Loading schema in Mapper

Schema is loaded automatically.
For any details, please refer to the 'Editing Schema'

Mass data processing

Mass data processing is supported.

PSP Usage

PSP is supported.
For details on PSP, refer to "Parallel Stream Processing".

Available component variables

Component variable name Description Remarks
count Return number of read columns.
  • The value defaults to null.
  • Null when using Parallel Stream Processing.
message_category Stroes the category to which corresponding message code belongs to, when an error occurs.
  • The value defaults to null.
message_code Stores its corresponding message code of occured error.
  • The value defaults to null.
message_level Stores the severity of the corresponding message code of the occured error.
  • The value defaults to null.
error_type Stores the type of the occured error.
  • The value defaults to null.
  • Error is represented in the format depicted below.
    Example:java.io.FileNotFoundException
  • The message may vary depending on the DataSpider Servista version.
error_message Stores the error message for the occured error.
  • The value defaults to null.
  • The message may vary depending on the DataSpider Servista version.
error_trace Stores stack trace of the occurred error.
  • The value defaults to null.
  • The message may vary depending on the DataSpider Servista version or the client application used.

Null and empty string

Specification Limits

Main exceptions

Exception name Cause Solution
ResourceNotFoundException
Resource definition could not be found.Name:[]
The [Format] is not specified. Specify the [Format].
ResourceNotFoundException
Resource definition could not be found.Name:[<Global Resource Name>]
The resource definition specified in the [Format] is not found. Make sure the global resource specified in the [Format].
InvalidPropertyConfigurationException
<Property name> is not specified.
[<Property name>] is not specified. Specify the [<Property name>].
FileIsDirectoryException Path input in [File] is directory. Input file path in [File].
StructuredTextParseException
Could not read the file in the specified format.
The file specified in the [File] can not be parsed by the format specified in the [Format]. Make sure the [File] or [Format].
java.io.FileNotFoundException The file specified in [File] does not exist. Check the [File].
java.io.UnsupportedEncodingException The encoding that is not supported is specified in [Encoding]. Specify an encoding that is supported in Java SE Runtime Environment 8.
Refer to "Supported Encodings"(http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) for details.