Scenario: Parsing delimited file using the cFlatPack component
This scenario applies only to a Talend solution with ESB.
In this scenario, a cFile component reads a delimited file
from the local file system, which contains the customers information including id, first
name, surname, and order id, as shown below:
1 2 3 4 5 |
1,"Harry",Carter,21 2,Padre,Boulevard,22 3,Andrew,Polk,23 4,Herbert,Reagan,"24" 5,Chester,Eisenhower,25 |
The file is parsed by the cFlatPack component, using
a predefined PZMAP XML file:
1 2 3 4 5 6 7 8 9 10 |
<?xml version="1.0"?> <!-- DTD can be pulled from the Jar or over the web--> <!DOCTYPE PZMAP SYSTEM "flatpack.dtd" > <!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >--> <PZMAP> <COLUMN name="id" length="5" /> <COLUMN name="name" length="20" /> <COLUMN name="surname" length="20" /> <COLUMN name="orderid" length="5" /> </PZMAP> |
The customer information is then printed in the execution console by a cBean component.
For more information about the PZMAP file configuration, see the website http://flatpack.sourceforge.net/documentation/index.html.
Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Login
0 Comments