09-03-2010 07:02 AM
Plataform: Labview Developer Suite Sound and Vibration Option 2009 SP1
I need format some number and strings to insert in txt file using For Loop. This structure above make the service but insert a blank space when execute external loop. I need remove this blank space, i tried several ways but dont get sucess.
Look to arrow in figure.
Solved! Go to Solution.
09-03-2010 07:30 AM
The "Array to spreadsheet string" function apparently puts in a "carriage return, new line" pair every four lines (one "row" of the original array). I could find any setting that prevents it, not sure why it shows up as a space, but if you put a "search and replace" (from the string function pallette) and search for a "Carriage Return Constant" and replace with an "Empty String", setting the optional boolean "Replace All?" to true it removes them.
09-03-2010 08:09 AM
Very good, thanks. The headshot faster from forum.
09-03-2010 10:03 AM - edited 09-03-2010 10:03 AM
What is actually happening is that you are getting a \r\n at the end of each "row" of the 2D array. You are not getting a space. This is well-known behavior of the Array to Spreadsheet String, and is also documented:
Converts an array of any dimension to a table in string form, containing tabs separating column elements, a platform-dependent EOL character separating rows, and, for arrays of three or more dimensions, headers separating pages.
On Windows the EOL character is \r\n. So, each row will have a \r\n. If you were to use a tab instead of a \r and set the indicator to "\" display mode you would see this behavior:
09-03-2010 10:43 AM - edited 09-03-2010 10:44 AM
Others have already explaine what is happening. Here's a better way to do all this. Modify as needed.
(It seems useless to first built a 2D string array just to convert it to a spreadsheet string later. This can be done in one step. :))