Page 1 of 1

carriage return in csv file

Posted: Wed May 06, 2015 6:25 pm
by negley
I am creating a CSV file using Universal. I do have line returns, but not carriage returns. Because of this, the customer i am working with can not process the file. Do i need to do anything special to have carriage returns in my csv?

I am writing out two formats, one with all the data and another with a blank space.

When i view the output file on Notepad++ i see line returns, and it looks correct to me. However, if it is view with notepad, everything is together on one line.

-Bill

Re: carriage return in csv file

Posted: Wed May 06, 2015 6:46 pm
by Glenn
Bill,

I believe that officially you need to use carriage return, line feed (/r/n) for Windows. Unix and it's variants only use line feed (/n). So, depending, on the ultimate destination of the csv you may need to use carriage return, line feed (/r/n).

I believe that Unix and it's variant understand both versions so I would try the /r/n option and see if it works.

http://stackoverflow.com/questions/8755 ... haracter-n

Glenn

Re: carriage return in csv file

Posted: Thu May 07, 2015 8:01 am
by negley
How does what work with universal? Do i add a line that simply has /r/n? If i do, it is treated as normal text.

-Bill

Re: carriage return in csv file

Posted: Thu May 07, 2015 8:12 am
by negley
I figured it out.

I went into the raw DDS source made a change to the content attribute:

Old
2HTML('{"screen":{"record format nam-
e":"LineFeed","existing file action-
":"append","destination":{"fieldNam-
e":"FILENAME","dataLength":"100","t-
rimLeading":"false","trimTrailing":-
"true","blankFill":"false","rjZeroF-
ill":"false","dataType":"char","for-
matting":"Text","textTransform":"no-
ne","b":"Screen","property":"destin-
ation"},"document type":"csv"},"con-
tent":["\n"]}')

New
2HTML('{"screen":{"record format nam-
e":"LineFeed","existing file action-
":"append","destination":{"fieldNam-
e":"FILENAME","dataLength":"100","t-
rimLeading":"false","trimTrailing":-
"true","blankFill":"false","rjZeroF-
ill":"false","dataType":"char","for-
matting":"Text","textTransform":"no-
ne","b":"Screen","property":"destin-
ation"},"document type":"csv"},"con-
tent":["\r\n"]}')

Works great now

-Bill

Re: carriage return in csv file

Posted: Thu May 07, 2015 5:36 pm
by Scott Klement
I think I'm going to take this thread as a "feature request". We should have an option where you can set Unix or Windows type EOL characters in the Universal designer.

Unfortunately, we don't have that now, so you'll have to modify the JSON data (as you already discovered -- very impressed that you figured that out, by the way.)

Re: carriage return in csv file

Posted: Tue Jun 23, 2015 8:32 am
by kfritz
I have a similar case.
I can put a linefeed in the grid header and receive the header displayed properly. (2 lines f.e.)
If I export the grid to Excel, the linefeed is removed from the header line.

I was using the Excel export Api of the grid.

Thanks,
Karl

Re: carriage return in csv file

Posted: Tue Jun 23, 2015 2:00 pm
by Scott Klement
Hi Karl,

This discussion was about building a CSV file using a universal display. Our universal display always uses Unix-type line feeds (LF but no CR).

You are talking about the CSV export option in our Rich Display subfile widget, and you are saying that it drops an embedded CRLF in the middle of a heading. So it is a very different situation from the original discussion.

If you think that this is a bug in Profound UI, please file a bug report with support@profoundlogic.com

Re: carriage return in csv file

Posted: Wed Jun 24, 2015 10:30 am
by kfritz
Hi Scott,

As I mentioned, it's a similar case in PUI. If I split a grid header title with < BR > the header will be shown correctly in PUI, but the Excel Api ignores the line feed. I sent a mail to the support.

Thanks,
Karl