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
Forteen 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
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Highlighted
Forteen 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
Don't forget to give kudos/accept the solution when a replay is helpful.
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 

Forteen 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
Don't forget to give kudos/accept the solution when a replay is helpful.
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

Forteen 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
Don't forget to give kudos/accept the solution when a replay is helpful.
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 

Forteen Stars

Re: Text Enclosure and Escaping Character

@CK395,great, Please provide Kudos alsoSmiley Happy 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now