Text Enclosure and Escaping Character option in tfileinputDelimited

Five Stars

Text Enclosure and Escaping Character option in tfileinputDelimited

Suppose I have a tFileInputDelimited file with data as below (1st line header) :-

Column1;column2;column3
@111@;@xxx@;@987@@
@222@;@YYY@;@874@@

Job design as below :-
tfileInputDelimited--> tLogRow

 

  • tfileInputDelimited CSV option  properties as below :-

escape char "@"
Text encloser """

then the tLogRow will give below output:-

Column1|column2|column3
@111@|@xxx@|@987@@
@222@|@YYY@|@874@@

 

  • tfileInputDelimited CSV option  properties as below :-

escape char """
Text encloser "@"

then the output in tLogrow

Column1|column2|column3
111|xxx|987
222|YYY|874


In the above example, it seems like whatever text Encloser is mentioned its expecting the value of the field within that characters followed by delimiter.

Then can you please let me know what is the use of Escape char option in this. And how this can be used with an example.

Employee

Re: Text Enclosure and Escaping Character option in tfileinputDelimited

Hi @shameer ,

 

    Lets clear the fog with these terms.

 

Field Separator - This is the most important value which will separate the values between columns for a csv file. In your case, it will be semicolon.

 

Text Enclosure - Even if there is a break in the value like more than one word or a big paragraph with lot of line breaks, this value will help the csv reader to understand that all the data within that character set is one block. Generally double quotes is the most popular character set used for this variable.

 

Escape character - Imagine a case where you are getting text enclosure character itself as part of data. In this case, we need to inform the reader by adding a prefix with another character that it is indeed part of data. This is called escape character.

 

e.g:- "I would like to test loading of double quotes character "" and it seems to be working!"

 

If you add " as the escape character, it will check for the combination and will add the " in between sentence. If you are using some other symbol like @, you need to add the combination as @" to do the escape character.

 

Hope I cleared your query :-) Please spend a second to mark the topic as resolved if you do not have any further queries.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read