Remove quotes from comma delimited file

Six Stars

Remove quotes from comma delimited file

Hello,

 

I have the following workflow:

tFileInputDelimited -> tmap -> databaseOutput

The program that created the csv file (and will do so daily) is adding quotes to the strings and dates, however, I need to remove these quotes prior to it being sent to tmap. How can I do this?

 


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Remove quotes from comma delimited file

Hi,

You may add a tJavaRow before the tMap component to remove the quotes from the concerned fields:

output_row.yourField = input_row.yourField.replaceAll("\"", "");

 


TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: Remove quotes from comma delimited file

Hi,

You may add a tJavaRow before the tMap component to remove the quotes from the concerned fields:

output_row.yourField = input_row.yourField.replaceAll("\"", "");

 


TRF
Six Stars

Re: Remove quotes from comma delimited file

When you say yourfield, what does this represent? The quotes show up in several places in the row, but not always the same place.

Six Stars

Re: Remove quotes from comma delimited file

I played with tjavarow and figured out how to use it.  

 

Thanks

Six Stars

Re: Remove quotes from comma delimited file

I have one error I cannot get by. The csv has a date in quotes. I am receiving an error replaceAll undefined for date. How can I get past this?
Forteen Stars TRF
Forteen Stars

Re: Remove quotes from comma delimited file

You're welcome

TRF
Ten Stars

Re: Remove quotes from comma delimited file

Unless I'm misunderstanding, you can configure tFileInputDelimited to remove quotes around incoming values by checking CSV Options and setting Text Enclosure to "\""
Two Stars

Re: Remove quotes from comma delimited file

Thanks cterenzi. I hadn't considered selecting csv options for my tab delimited file to get rid of the double quotes universally throughout the tfileinputdelimited. Solved a lot of ad hoc changes I was making later on.

One Star

Re: Remove quotes from comma delimited file

I like this method.. Simple since built into the "File Delimited" meta data creation. You can also see result in the preview window (after refresh preview)

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.