Parsing delimited file using the cFlatPack component - 7.1

Flatpack - Mediation

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Processing components (Mediation) > Flatpack components (Mediation)
Data Quality and Preparation > Third-party systems > Processing components (Mediation) > Flatpack components (Mediation)
Design and Development > Third-party systems > Processing components (Mediation) > Flatpack components (Mediation)
EnrichPlatform
Talend Studio

This scenario applies only to Talend Open Studio for ESB, Talend Data Services Platform and Talend Data Fabric.

For more technologies supported by Talend, see Talend Mediation Components.

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,"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:

<?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.