LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the '\b' backspace code to remove a trailing comma

I am using LabVIEW 2009 on a PC running Windows XP.  I am trying to develop a section of a program that will take a 2-dimensional array of numeric data, convert the numeric data to strings, and for each row insert commas between each string that represents a numeric data, and then write this as a comma-separated-variable data format to a file.  Each column in the original array will end up as a separate line in the target text file.

 

Please see the attached picture of the part of my LabVIEW program for doing the above operation (the final write-to-file operations are not shown).

 

The problem that I am having is that I would like to delete the final comma at the end of the string for each line, just before the CR-LF.  I am using the \b code for backspace in the string concatenate function, however this does not appear to be working.  Here is an example output that I get:

 

2.500000E+0,2.500000E+0,2.500000E+0,2.500000E+0,2.500000E+0,2.500000E+0,

 

I stuffed the entire array with the value of 2.5 for each element.  Notice that the final comma was not removed, but a strange character (the box) was added at the end.  The CR-LF did work.  If I remove the \b from this program, the box character goes away.

 

Any suggestions?  Thanks.

0 Kudos
Message 1 of 3
(3,750 Views)

How about using "array to spreadsheet string" with comma as delimiter? One step!

 

(Your \b is just another character added to the string, it does not perform any editing operation)

Message 2 of 3
(3,737 Views)
Also, if all you just need to do is write the result to a file, use write to spreadsheet file instead with comma as delimiter. Nothing else needed.
Message 3 of 3
(3,730 Views)