One Star

[resolved] Escape character in csv

Hi all;
I am trying to ignore "\" character in an adress line in a .csv file,
e.g.= "Zoologiska artiklar - Tillverkare Grossister\,",Limex AB in this line backspace (\) character should be an escape character
i tried to use tFileInputDelimited and set Escape Char to "\" but it did not work. Is there any simple way to do it?

Best Regards
bahadir.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Escape character in csv

Hi
It is impossible to ignore the character "\" in the example file you gave, however, you can remove it on other component such as tMap later. please see my screenshots.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
9 REPLIES
Community Manager

Re: [resolved] Escape character in csv

Hello
Did you try "\\"? if it doesn't work, please show us an example file and what are your expected result?
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Escape character in csv

my input file is like that :
asd\,ghj
asd,dfg
(comma is the field seperator)
what i expect is :
asd,ghj
asd,dfg
Community Manager

Re: [resolved] Escape character in csv

Hi
It is impossible to ignore the character "\" in the example file you gave, however, you can remove it on other component such as tMap later. please see my screenshots.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Escape character in csv

Hi,
This one works great, thank you very much Shong.
Best Regards
Bahadir
One Star

Re: [resolved] Escape character in csv

Hi there -
I have a csv file in which a particular column (address column) has a text value that contains a comma (e.g. "2000 Redwood Shores, Redwood city, CA"). I want to be able to read this entire value as one value and not be split because there are commas in the value
To do this, I set the csv options for reading this file in tFileInputDelimited as follows:
Row Separator: "\n"
Field Separator: ","
Escape Char: ""
Text enclosure: """
But unfortunately, the tool still considers the comma in the value as a field separator and returns the following as three separate fields:
2000 Redwood Shores
Redwood city
CA
Can you please throw some light on this
Thanks
Sri
Community Manager

Re: [resolved] Escape character in csv

Hi Sri
Try
Escape Char: "\""
Text enclosure: "\""
If it still don't work, please show us an example of file.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Escape character in csv

Hi Sri
Try
Escape Char: "\""
Text enclosure: "\""
If it still don't work, please show us an example of file.
Best regards
Shong

Hi Shong,
I had the same issue, in fact only keeping Text enclosure: "\"" is required.
The selection of Escape Char seems to be immaterial.
So just wanted to know in which scenario so we use the escape char?
Regards,
Diwakar
Infocepts India
One Star

Re: [resolved] Escape character in csv

Hi,
I have same scenario,
Input Row
1\t"Max"\t"The \" Moon"\t"Sky"
Output Row Should be
1 | Max | The " Moon | Sky

I am using Field Separator "\t" , Text enclosure as """ and Escape char as "\"".But its still not working.
What should i use???
Five Stars

split and join with mysql table a csv file column value

thanks in advance,

i have a column value in csv file like "CTH#RIO" for this i want to split this value lke CTH and RIO  and join with another table from mysql database using tmap component , how can i doo this job

 

 

Thanks & Regards

Tags (1)