From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate Array to spread string with format into String in one Row

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

0 Kudos
Message 1 of 18
(6,004 Views)

Please attach the actual VI instead of a picture. Does that 2D array really contain only a single element?

Message 2 of 18
(5,995 Views)

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.

Message 3 of 18
(5,992 Views)

Get rid of the build array.  You're only using strings.  Use concatenate String and be done with it.

Message 4 of 18
(5,989 Views)

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.

Message 5 of 18
(5,986 Views)

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.

FORMAT.png

Message 6 of 18
(5,982 Views)

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

Message 7 of 18
(5,981 Views)

Array to Spreadsheet String adds a line feed at the end of the string, so use Trim Whitespace to get rid of it. 

Trim Help.PNG

 

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


Message 8 of 18
(5,979 Views)

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

Message 9 of 18
(5,967 Views)

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

 

Message 10 of 18
(5,946 Views)