07-27-2010 10:42 AM
It's a simple little test but it is driving me nuts. The first line of the output is fine but every other line has an extra TAB inserted at teh beginning of the line. I clipped out the section of the diagram and the offending section of the output file. The only part missing from teh diagram is teh write to file, there is nothing inserted into the file inside my write to file vi...
Solved! Go to Solution.
07-27-2010 10:52 AM
Don't put the carriage return line feed at the end of the string. The array to spreadsheet string should be taking care of that for you automatically.
Otherwise, please post your VI so we can see what it is doing.
07-27-2010 11:13 AM - edited 07-27-2010 11:14 AM
@Ravens Fan wrote:
Don't put the carriage return line feed at the end of the string. The array to spreadsheet string should be taking care of that for you automatically.
Otherwise, please post your VI so we can see what it is doing.
Removing the "new line" puts all the data on one line since it is a single dimensional array
I have attached a working vi of the offending section.
07-27-2010 11:15 AM - edited 07-27-2010 11:23 AM
The extra tab is added by the Array to spreadsheet string function. Modify your vi as shown below.
Basically, the Spreadsheet to Array format a string by adding a separator between the array elements. Since you feed in a 1D array, the function generate a single line string with (default) Tab separators. However, since you have added a CR in each of the 1D array elements, you get several lines, with an extra tab just after the CR, as ordered. The solution is therefore to remove the added CR and chage the default separator for a CR.
07-27-2010 11:25 AM
Thanks charly, I swear I have been using the Array to Spreadsheet function for years and never ran into this problem. Must be because I used to always make "CSV" files and use a comma as my delimiter. I recently have had to change to making XLS files because newer versions of M$ Orifice seem to have troubles with CSV files. Or at least the people I send CSV files to recently seem to have trouble opening them...
I also noticed you recomend the "In range and coerce".
I never use that one, for some reason it's usage is frowned upon by my superiors.
07-27-2010 11:47 AM
RTSLVU a écrit :I also noticed you recomend the "In range and coerce".
I never use that one, for some reason it's usage is frowned upon by my superiors.
We all have our wiring habits. I never use the Pass/Fail function. My version of your vi (end only) would possibly have been :
But I would most probably have ended with a single concatenate and two Number to string operations. A better compact design.