LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting ASCII data for other platforms

Highlighted

Situation:

 

Measurement platform : Labview 8.6 running on Fedora 10.

 

The output data is in the shape of an ASCII file containing multiple columns of data with linefeeds as the EOL character.

 

Some of the users read this data on windows and run into the obvious problem (columns are mucked up). Is there a way to specify CR LF as the EOL in the VI somewhere ?

 

I have helped the users with the command line unix2dos utility but many of them are command line shy, and in any case, this should be doable in LabVIEW (or so I hope). 

0 Kudos
Message 1 of 8
(1,115 Views)
Highlighted
Are you using the End of Line Constant when you are writing the file? This will generate a LF on Unix, and a CR/LF on Windows. What are you using to write the file? What are your users using to read the file? Is it another LabVIEW program?
0 Kudos
Message 2 of 8
(1,107 Views)
Highlighted

How do your users read the file under windows?

 

AFAIK, only notepad cannot correctly display text with only linefeed characters and thus will no wrap correctly.

 

Have them use wordpad (or ms word, etc.) and it should all look OK. Try it!

Message Edited by altenbach on 02-08-2010 04:31 PM

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 3 of 8
(1,099 Views)
Highlighted

I use Textpad ( http://www.textpad.com/ ) for files shared between Windows and Unix. 

Works great.

______________________________________________________________________
0 Kudos
Message 4 of 8
(1,087 Views)
Highlighted

I am just using the write to spreadsheet VI.

 

I am not specifying any EOL.

 

The users analyze the data in Microcal Origin and Kaleidagraph. Both mess it up when they do not get the right EOL. If I manually convert it using unix2dos, it works fine.

 

So, I need a way to generate the windows EOL in Labview running on Linux. 

0 Kudos
Message 5 of 8
(1,054 Views)
Highlighted

Use the Array to Spreadsheet String VI.  Then search through the string and replace all LF with CR/LF or whatever EOL character you want.  Then write the string to file with the basic Write Text to File function.

 

This is one situation where the easy-to-use, built-in function is not quite adequate and you have to make your own.

 

Lynn 

0 Kudos
Message 6 of 8
(1,051 Views)
Highlighted

Maybe the simplest thing to do is to call unix2dos from labview.

 

Is there a way to call a bash shell command from labview on linux ? 

0 Kudos
Message 7 of 8
(1,026 Views)
Highlighted

Hi m-s,

 

You should be able to using the System Exec VI:  http://zone.ni.com/reference/en-XX/help/371361F-01/glang/system_exec/ 

0 Kudos
Message 8 of 8
(993 Views)