Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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.
yes, I use "\"" for both
If I use it for both, I get text enclosures as "", which I don't need in my requirement.
Thanks,
Suneel
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)