Issue with row seperator in tFileOutputDelimeted

Four Stars

Issue with row seperator in tFileOutputDelimeted

Hi,

 

I am trying to put data from excel to csv file. So my excel row contains a string which includes "\n" like "Hello \n Hi \n". If I do convert to csv with Row seperator \n every word is taken as new record in csv file. (Hello and Hi as twodifferent rows) What should I use in this case? Can anyone suggest?

 

Thanks,

Suneel.

Forteen Stars

Re: Issue with row seperator in tFileOutputDelimeted

Hi,

 

2 variants:

-  \n inside text sometime must be preserved  in this case you need export text with csv options "" for string and use escape character, many tools understand this

- if you want just remove \n inside text and have straight row - use tMap and replaceAll("\n","") for columns where them presented

-----------
Four Stars

Re: Issue with row seperator in tFileOutputDelimeted

Hi, 

 

Thanks for the reply.

The second point of ur's is not applicable in my case because, I should not change the data.

The first point- Can u elaborate.

Screen Shot 2019-01-22 at 2.15.24 PM.png

Highlighted
Forteen Stars

Re: Issue with row seperator in tFileOutputDelimeted

yes, I use "\"" for both

-----------
Four Stars

Re: Issue with row seperator in tFileOutputDelimeted

If I use it for both, I get text enclosures as "", which I don't need in my requirement.

 

Thanks,

Suneel

Forteen Stars

Re: Issue with row seperator in tFileOutputDelimeted

this is only one way for save \n inside text and not crash feature import
it is very common for csv export/import and you destination must understand this quotes (for example any database understand this)

-----------

What’s New for Talend Spring ’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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch