06-28-2016 03:39 PM
Hi All
I want to Concatenate Array to spread string with format into String in one Row.
Please View the screen shot. I want to TRUE to be displayed after 10, not in the next line.
Thanks
Ravi
06-28-2016 04:09 PM - edited 06-28-2016 04:10 PM
Please attach the actual VI instead of a picture. Does that 2D array really contain only a single element?
06-28-2016 04:10 PM
Huh? I didn't get what you are trying to do. Think concatenate as a word processor, so what you want to be displayed, should match the way you would input it in a keyboard.
06-28-2016 04:11 PM
Get rid of the build array. You're only using strings. Use concatenate String and be done with it.
06-28-2016 04:12 PM
Array to spreadsheet string appends a delimiter, so don't use that function. It is pointless here.
All you probably need is a single formatting statement.
06-28-2016 04:13 PM
Well the easiest way to do that would be to simply insert "Trim Whitespace.vi" between the Array to spreadsheet and the build array.
But it also seems like you might be better off using a "Format into string" although it depends on how many numbers you are going to be putting in there and what format they are going to be in.
06-28-2016 04:14 PM
@natasftw wrote:Get rid of the build array. You're only using strings. Use concatenate String and be done with it.
That's not the cause of the problem, because the later concatenation will concatenate the two array elements anyway, no difference in the end.
06-28-2016 04:14 PM - edited 06-28-2016 04:23 PM
Array to Spreadsheet String adds a line feed at the end of the string, so use Trim Whitespace to get rid of it.
Edit: ogk beat me to it
Your code is more complicated than it should be and you should use the Format Into String function like ogk suggested.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-28-2016 04:20 PM
@altenbach wrote:That's not the cause of the problem, because the later concatenation will concatenate the two array elements anyway, no difference in the end.
Maybe so. But, it's still silly to add the extra step in to do the same exact thing. There's zero value to the build array in there.
If the first primitive adds the line feed, trim whitespace will handle it and you should STILL only use the concatenate string.
06-28-2016 05:33 PM
@natasftw wrote:Maybe so. But, it's still silly to add the extra step in to do the same exact thing. There's zero value to the build array in there.
You were sending the OP on a snipe hunt, because replacing the built array with a concatenate operation will not solve his problem. (It is still good advice once the original problem is solved ;))
Yes, the problem is with the termination generated by "array to spreadsheet file" as I already pointed out in message 5. It was impossible to give more targeted advice because we had no actual code. There is no telling from the picture how many elements the array contains and if there was line wrapping going on in the string indicator. All "solutions" here made certain assumptions that may or may not be correct. 😄