Text Enclosure and Escaping Character

Seven Stars

Text Enclosure and Escaping Character

TestColumn1;TestColumn2;"TestColumn3:1;TestColumn3:2";TestColumn4

the above sample data contains delimiter as data in the 3rd column and i wish to fetch the data as 

TestColumn1

TestColumn2

"TestColumn3:1;TestColumn3:2

TestColumn4

 

the main concern here is to understand the working of "Text Enclosure and Escaping Character" option in tfileInputdelimited .

it would be really helpful if someone can explain this in detail that what these 2 options works and how they works.


Accepted Solutions
Highlighted
Thirteen Stars

Re: Text Enclosure and Escaping Character

@CK395,for input :< TestColumn1;TestColumn2;"TestColumn3:1;TestColumn3:2";TestColumn4> you will get the below output.

.-----------+-----------+---------------------------+-----------.
| tLogRow_1 |
|=----------+-----------+---------------------------+----------=|
|newColumn |newColumn1 |newColumn2 |newColumn3 |
|=----------+-----------+---------------------------+----------=|
|TestColumn1|TestColumn2|TestColumn3:1;TestColumn3:2|TestColumn4|
'-----------+-----------+---------------------------+-----------'

 

 

if you wan to know more about these,try to create metadata in the repository by using CSV option and you can play with option and get to know how the would be extracted form that csv.

Manohar B

All Replies
Thirteen Stars

Re: Text Enclosure and Escaping Character

@CK395,since when you enable CSV option,in  tFileInputDelimited,you can set those two options.

 

check the below link,you will understand the use case.

https://stackoverflow.com/questions/43512095/usage-of-escape-char-and-text-enclosure

Manohar B
Seven Stars

Re: Text Enclosure and Escaping Character

Hi @manodwhb ,

I am through that link already and it did not perform as it mention.

it would be helpful if you can explain it.

 

 

Regards 

Chandra Kant 

Thirteen Stars

Re: Text Enclosure and Escaping Character

@CK395,for Text Enclosure,for suppose your filed data is in like "Hello" then you will specify the """ .

for Escaping Character,which you want to be print as part of the data.

Manohar B
Seven Stars

Re: Text Enclosure and Escaping Character

Hi @manodwhb,

You mean if the data contains  inverted commas <"$$$$$$"> then only data<$$$$$$$>  can be fetched using TextEnclosure """ and to keep some symbol within the data that must be specified as Escape Character.

 

can you specify the <Text Enclosure> and <Escape Character> for case given below and please test it in a job.

input :< TestColumn1;TestColumn2;"TestColumn3:1;TestColumn3:2";TestColumn4>

output :

Column1Column2Column3Column4
TestColumn1TestColumn2TestColumn3:1;TestColumn3:2TestColumn4

or

Column1Column2Column3Column4
TestColumn1TestColumn2"TestColumn3:1;TestColumn3:2"TestColumn4

 i think it would clear some doubts.

 

 

 

Regards

Chandra Kant

Highlighted
Thirteen Stars

Re: Text Enclosure and Escaping Character

@CK395,for input :< TestColumn1;TestColumn2;"TestColumn3:1;TestColumn3:2";TestColumn4> you will get the below output.

.-----------+-----------+---------------------------+-----------.
| tLogRow_1 |
|=----------+-----------+---------------------------+----------=|
|newColumn |newColumn1 |newColumn2 |newColumn3 |
|=----------+-----------+---------------------------+----------=|
|TestColumn1|TestColumn2|TestColumn3:1;TestColumn3:2|TestColumn4|
'-----------+-----------+---------------------------+-----------'

 

 

if you wan to know more about these,try to create metadata in the repository by using CSV option and you can play with option and get to know how the would be extracted form that csv.

Manohar B
Seven Stars

Re: Text Enclosure and Escaping Character

hi @manodwhb,

this one simply worked with Escape<"""> and Enclosure<"""> once I restarted the Talend but was not working previously ,

Talend might be having some processing issues.

I appreciate your helpful replies and patience.

 

 

 

Thanks and Regards

Chandra Kant 

Thirteen Stars

Re: Text Enclosure and Escaping Character

@CK395,great, Please provide Kudos alsoSmiley Happy 

Manohar B

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.