File Input
Last updated
Last updated
The FileInput component is used to load data from files, and it can parse the contents of the file against a predefined data structure. This helps to ensure that the data being loaded is in the correct format and meets the required criteria before further processing is carried out.
Attribute | Description |
---|---|
Attribute | Description |
---|---|
If Use in mapping is yes, remove the default value and set a different value.
In this scenario, a source file containing data needs to be synchronized with a target database table. The source file has six columns: id, birth date, first name, last name, gender, hire date, and the target table has the same columns.
The flow starts with the FileInput task, which reads the source file and passes the data to the Mapping component. The Mapping component is used to transform the data into a format that can be inserted into the target table. In this case, it simply maps the source columns to the target columns with the same name.
Next, the SQLBatch task is used to execute a batch insert statement to insert the transformed data into the target table.
If the input file has a header line, the first row of data may be treated as invalid data or it may cause the data to be incorrectly mapped to the output. Therefore, it is recommended to remove the header line before processing the input file.
The input file is parsed against the data structure and stored in the parameter called MyEmployees. The parsed data is stored in a file backed list to avoid OutOfMemory issue.
Mapping does simply connect the input fields to the correspondent output fields.
SQLBatchExecutor gets input data from MappingResult.
Attributes
Description
Input Path
Assign input directory
Input File
Assign file name ??? only one file is allowed
Suffix Allowed
-
Wait Seconds
1
Contents Type
Data
Ignore File Not Found
-
After Get
-
Backup Path
-
Input Path
Input directory
Input File
Input file. File name can contain wild card (*).
Suffix Allowed
Extension list delimited with comma(,).
ex) *.txt, .dat ??? files with txt extension or dat extension will be loaded.
(*) Input File and Suffix Allowed are not mutual exclusive. Files which match either conditions are loaded.
Wait Seconds
Wait time in seconds until the file is not modified. Default seconds is 5 seconds.
Contents Type
The type of loaded contents.
· Byte array
· String
· ISM data
The default option is byte array. If ISM data is chosen, the contents are parsed against the predefined data structure. And this data structure comes from the Output property
Ignore File Not Found
Action when the input file is not found.
· Ignore
· Throw error
After Get
Action after the input file(s) are loaded.
· Do Nothing
· Backup
· Delete
Backup Path
Backup directory if the After Get action is backup.
FileContents
Contents of the input file(s). Contents are storead as byte array
DataStructureId
Data structure id for mapping
FileInfos
File list. This attribute contains java.io.File objects
UseMapping