carriage return in csv file

Use this board to ask questions or have discussions with other Universal Displays users.
negley
Profound User
Posts: 45
Joined: Tue Mar 11, 2014 2:50 pm
First Name: William
Last Name: Negley
Company Name: Utz Quality Foods
Contact:

carriage return in csv file

Post 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
User avatar
Glenn
Profound Logic Staff Member
Posts: 124
Joined: Mon Apr 14, 2014 4:08 pm
First Name: Glenn
Last Name: Hopwood
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: carriage return in csv file

Post 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
negley
Profound User
Posts: 45
Joined: Tue Mar 11, 2014 2:50 pm
First Name: William
Last Name: Negley
Company Name: Utz Quality Foods
Contact:

Re: carriage return in csv file

Post 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
negley
Profound User
Posts: 45
Joined: Tue Mar 11, 2014 2:50 pm
First Name: William
Last Name: Negley
Company Name: Utz Quality Foods
Contact:

Re: carriage return in csv file

Post 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
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: carriage return in csv file

Post 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.)
kfritz
Profound User
Posts: 64
Joined: Thu Aug 04, 2011 4:53 am
First Name: Karl
Last Name: Fritz
Company Name: Logic IT Services
Address 1: Fluhgasse 141
City: Laufenburg
Zip / Postal Code: 5080
Country: Switzerland
Location: Switzerland
Contact:

Re: carriage return in csv file

Post 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
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: carriage return in csv file

Post 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
kfritz
Profound User
Posts: 64
Joined: Thu Aug 04, 2011 4:53 am
First Name: Karl
Last Name: Fritz
Company Name: Logic IT Services
Address 1: Fluhgasse 141
City: Laufenburg
Zip / Postal Code: 5080
Country: Switzerland
Location: Switzerland
Contact:

Re: carriage return in csv file

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest