08-23-2010 02:13 PM
We all know the 'Write to text file function'
We all know the EOL glyph on the function, and how to turn it off.
But when we want to know what exactly happens, we go to the help.
A first skim does not show the EOL option.
So we use search on that page and we find a not about EOL function:
This function appends platform-dependent end-of-line (EOL) characters to the elements of an array even if you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item.
So you read this long sentence, and think 'oh yes'.
Then you re-read.
And your brain starts working (our the caffeine is kicking in), and you think, wait a minute, this only tells me when the EOL setting is ignored.
The documenation for this basic function DOES NOT MENTION THE SINGLE OPTION YOU HAVE TO CONFIGURE.
Please fix these little things.
This setting is important, because it might alter our data, so we have the right to know what happens.
Ton
08-23-2010 02:25 PM
It doesn't sound like it's ever off. To me this line:
This function appends platform-dependent end-of-line (EOL) characters to the elements of an array even if you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item.
... means that the function will add an EOL and although there's a switch to turn the behavior OFF it will ignore you and do it anyway.
I think I'll try it and see what it really does.
08-23-2010 02:48 PM
I checked my old 7.1. help:
convert eol determines whether the function converts the end of line markers it writes into system end of line markers. An end of line marker is a carriage return followed by a linefeed on Windows, a carriage return on Mac OS, and a linefeed on UNIX. The LabVIEW end of line marker is a linefeed.
So on Win and LINUX, nothing happens cause LV, Win and LINUX all use LF.
I just guess this replaces all LF by a CR if using a Mac.
Felix
08-23-2010 02:53 PM
There is an example that explains a lot:
C:\Program Files\National Instruments\LabVIEW 2010\examples\general\functions\File IO\Write-Read Text File.vi
08-23-2010 03:34 PM
@f. Schubert wrote:
I checked my old 7.1. help:
convert eol determines whether the function converts the end of line markers it writes into system end of line markers. An end of line marker is a carriage return followed by a linefeed on Windows, a carriage return on Mac OS, and a linefeed on UNIX. The LabVIEW end of line marker is a linefeed.
So on Win and LINUX, nothing happens cause LV, Win and LINUX all use LF.
I just guess this replaces all LF by a CR if using a Mac.
Felix
I guess your wrong.
Win: CR/LF
Lin: LF
Mac: CR
So whenever LabVIEW encounters a Linefeed in the datastream to store it will place a CR/LF on my Windows machine.
I find it quite strange that this functions has one (1) parameter and the help does not describe this option. and that I have to dig through the examples.
And this examples doesn't really clarify what happens.
Ton
08-23-2010 03:58 PM
OOps, I was wondering why Win and Linux were the same, cause I new they were different. Thanks for pointing out my mistake.
Anyway, at least this a documentation bug.
Propably this is even a code bug, but everyone that is using a cretain set of OSes is used to deal with it correctly.
Felix
08-23-2010 04:12 PM
Unless your are using cross platform, then most people would not notice it.
Imagine a data-aquisition system written in Unix/Linux and the data is reviewed on a Mac. 😉
I'm sure the code would not be written using the Write to text file.vi..
Well... the programmer would soon discover that an alternative method would be appreciated. 😄
09-03-2010 06:39 AM
Hi All,
thank you so much for your discussion; I created a request to make this documentation more complete, this is done by a corrective action request (CAR); 247469.
Have a great weekend in advance,
09-03-2010 11:37 AM
Interesting that the initial post was from Ton in the Netherlands and NI's response is also from there!
09-03-2010 02:08 PM
Hi Putnam Monroe,
This is because Ton is from the Netherlands; he marked this in his NI profile. After a while (when no respond) the forum post is send to the local office from the person who started the forum post. I was a little bit behind in answering the posts, so I'm sorry for the delay.
Greetings from the Netherlands,