Escape character CSV

Four Stars

Escape character CSV

Hello in Tmap I have :

"{" + '"' + row1.statut + '"' + "}"

But in my CSV in row I have :

"Test","{""in use""},"2","3"

I need a csv structure :
But for the row i don't need double quote ""

i want :

"Test","{"In use"},"2","3"

Thanks !!
Ten Stars

Re: Escape character CSV

I'm going to assume the relevant value is meant to be: "{"in use"}" as having a leading quote but no trailing quote is going to cause problems.


Talend is escaping the inner quotes so whatever reads the file treats them as data and not string enclosures.  If you want the raw output to look like "{"in use"}" turn off CSV options on your output component and manually wrap your values in quotes.  Otherwise, tFileOutputDelimited is going to require an Escape Character value, and is going to escape inner quotes in your strings.


Out of curiosity, what program or process is going to read your output file that you don't want to escape your quotes?


Four Stars

Re: Escape character CSV

I don't understand who wrap manuelly the value with quotes in tmap ?
I have to keep the quotation marks because from time to time a value of a column may contain commas that disrupts the import because it gives different columns
Ten Stars

Re: Escape character CSV

You have quotation marks as data in a csv file where values are wrapped in quotes.  This requires a way to differentiate between quotes wrapping values and quotes that are part of data values-- usually handled by escaping the data quotes.  Standard ways of escaping quotes are to double them when they're data quotes or to place an escape character in front of a data quote.  Which method you choose depends on what you're going to do with the csv file after you produce it.

Four Stars

Re: Escape character CSV

In the input CSV I have:


"TEST","In use","Solaris, Windows","les serveur "entrees" sont","trois"


So there are commas or double quotes in the data.
In output I am obliged to have a structure:


 "TEST","In use","Solaris, Windows","les serveur "entrees" sont","{"In use"}"


To properly integrate the real encapsulated data between ," ",


You understand ?

Ten Stars

Re: Escape character CSV

The last two tokens are not properly encapsulated as there's nothing to indicate that the inner quotes are not a text enclosure. If you need to create an output string exactly like this, you're going to have to construct it yourself. Otherwise, the tFileOutputDelimited component is going to try to escape the inner quotes in some manner.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey


Talend named a Leader.

Get your copy


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


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


APIs for Dummies

View this on-demand webinar about APIs....

Watch Now