LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert string to 1D or 2D string to write in Spreadsheet

Hi,

 

I have a String to write in Spreadsheet. I need to convert that string to 1D or 2D so that it can be compatible with the input of Write to Spreadsheet file.vi

 

I am using string type for this VI instead of Integer.

 

Thanks.

0 Kudos
Message 1 of 13
(3,586 Views)
Is the string a single text value or is mutiple values separated by some delimiters? If it's just a single, just use the build array and wire it to the 1D input. Spreadsheet String to Array can be used for anything else.
Message 2 of 13
(3,583 Views)

These are multiple values sapretade by space and tab. Build array does not accept string as input. Please correct me if i am wrong.

 

Thanks

0 Kudos
Message 3 of 13
(3,569 Views)

Bhandi wrote:

... Build array does not accept string as input. ...

Thanks


Wrong!

 

Build array does accept a string as an input.

 

 Array-of_Strings.png

 

Ben

Message Edited by Ben on 09-01-2009 01:48 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 13
(3,562 Views)

Hi, look at this example. I hope that it help you.

 

0 Kudos
Message 5 of 13
(3,560 Views)

What about when the text in the string is separated by \n (new line)? I´ve tried build array but just get the first line.

 

Thanks

0 Kudos
Message 6 of 13
(2,923 Views)

@Arroyo wrote:

What about when the text in the string is separated by \n (new line)? I´ve tried build array but just get the first line.


This is an old thread and your question makes very little sense without additional context. Please start a new thread and give more details. Attach your code if possible.

 

If the string is already formatted with delimiters, simply write it to a file using "write to text file". It seems silly to invoke "write to spreadsheet file" if you only have a single element.

 

can you show us your code? Where does the string come from?

0 Kudos
Message 7 of 13
(2,920 Views)

Hey,

 

I want to append the multiline string (as a single cell) to a excel sheet containing other info. The other columns of my .xls contain 1D strings built into an array,  so I cannot append my string directly. I tried to "build array" first which just gets the first line of the multiline string. Then I tried with Trim Whitespaces with the same results. 😕

 

Thanks

 

0 Kudos
Message 8 of 13
(2,913 Views)

Your code has nothing to do with excel. You cannot use delimiters inside your your array elements that use reserved delimiters.

0 Kudos
Message 9 of 13
(2,904 Views)