LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where is the extra TAB coming from?

Solved!
Go to solution

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...

========================
=== Engineer Ambiguously ===
========================
Download All
0 Kudos
Message 1 of 6
(2,660 Views)

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.

0 Kudos
Message 2 of 6
(2,644 Views)

 


@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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 6
(2,631 Views)
Solution
Accepted by topic author RTSLVU

The extra tab is added by the Array to spreadsheet string function. Modify your vi as shown below.

 

20019i6027794C1AF788C7

 

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.

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 4 of 6
(2,629 Views)

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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 6
(2,618 Views)

 


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 :

20029i0D0A8DAFA214788F

 

But I would most probably have ended with a single concatenate and two Number to string operations. A better compact design.

Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 6 of 6
(2,610 Views)