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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve 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
7 REPLIES
Twelve Stars TRF
Twelve 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?
Twelve Stars TRF
Twelve 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.