06-22-2023 07:37 AM
Hi,
I have a row of data from sql
It's have more data in row
I need to split those data's
Ex :
Actual data
"Rajesh","ramesh","raj"
I expect element by element
Element 1 Rajesh
Element 2 Ramesh
Element 3 Raj
06-22-2023 07:50 AM - edited 06-22-2023 07:57 AM
@Rajeshe432 wrote:
Hi,
I have a row of data from sql
It's have more data in row
I need to split those data's
Ex :
Actual data
"Rajesh","ramesh","raj"
I expect element by element
Element 1 Rajesh
Element 2 Ramesh
Element 3 Raj
Your title is confusing. It is not clear what you have and what you want.
If ["Rajesh","ramesh","raj"] is a single string with comma delimiters, you can convert it into a 1D array using "spreadsheet string to array".
Assuming ["Rajesh","ramesh","raj"] is a 1D array of string with three elements, you can use index array to get any one. If you want to process them in order, autoindex using a FOR loop to iterate over the elements.
It would help if you could attach a simple VI that has your input and desired output.
06-22-2023 07:52 AM
Hi Raj,
@Rajeshe432 wrote:
I have a row of data from sql
It's have more data in row
I need to split those data's
Ex :
Actual data
"Rajesh","ramesh","raj"
I expect element by element
Element 1 Rajesh
Element 2 Ramesh
Element 3 Raj
To split a string into an array of substrings based on a delimiter char you may use SpreadsheetStringtoArray.
To remove quotation marks from strings you may use SearchAndReplaceString.
What have you tried and where are you stuck?
06-03-2025 03:36 AM
Hello,
I used "Spreadsheet String to Array" to separate my incoming data into individual lines. Now I have something like this:
["%f, %f, %f", "%f, %f, %f", "%f, %f, %f", ...] Each string contains three comma-separated values.
What I would like to do is extract the three values from each string and place them into three separate float arrays.
For example, given:
["1,2,3", "4,5,6"]
I want to obtain:
Array 1: [1.0, 4.0]
Array 2: [2.0, 5.0]
Array 3: [3.0, 6.0]
How can I do this efficiently in LabVIEW?
Thanks in advance!
06-03-2025 04:33 AM - edited 06-03-2025 04:33 AM
Hi Quinon,
@Ouinon wrote:
How can I do this efficiently in LabVIEW?
Autoindexing is very efficient in LabVIEW!
06-03-2025 05:43 AM
You can convert a spreadsheet directly into a 2D-array if rows are separated by newlines
spreadsheet string to 2D array
06-03-2025 08:00 AM - edited 06-03-2025 08:14 AM
I tried something like this, but I'm getting an error with the Scan From String block:
And I also tried this, but it only shows 0...
06-03-2025 08:16 AM
@Ouinon wrote:
I tried something like this, but I'm getting an error with the Scan From String block.
In your first String to Array the Format just should be "%s" instead of 3x %f (you're grabbing the whole line as a string)
06-03-2025 09:15 AM
Even after changing this parameter, I still get the error:
LabVIEW: (Hex 0x55) The scan failed. The input string does not contain data in the expected format.
06-03-2025 09:39 AM
How does your input string look like? Can you give a verbatim example? Use probes and indicators to inspect the incoming data.