LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read csv into individual arrays

Solved!
Go to solution

Hi,

 

I'm trying to read a csv file with 2 columns into 2 separate arrays for interpolation. But I am unable to convert the read data into arrays.

 

Attached is the VI for reading and displaying data.

 

Thanks

 

Sketch.png

0 Kudos
Message 1 of 7
(12,293 Views)
Solution
Accepted by topic author utkarsh.17

You probably should also attach one of your csv files.

 

(In general, to get a row or column, "index array" is the right function, just keep one index dimension disconnected.)

0 Kudos
Message 2 of 7
(12,284 Views)

Here is an example csv 

0 Kudos
Message 3 of 7
(12,271 Views)

Thanks. I first used transpose and then index to get x and y.

0 Kudos
Message 4 of 7
(12,267 Views)
Solution
Accepted by topic author utkarsh.17

As altenbach said, you're looking for the Index Array function.

 

You can drag the bottom edge downwards to get two indexing operations in one node. Just wire the 'Column' index and leave the row index blank.

 

csv.png


GCentralI'm attending the GLA Summit!
0 Kudos
Message 5 of 7
(12,253 Views)
Solution
Accepted by topic author utkarsh.17

If you wire to the lower dimension, you don't need to transpose.

 

 

 

(You can also select "transpose" when you read the file (boolean input). Then simply omit wiring any indices to get the first two columns.)

0 Kudos
Message 6 of 7
(12,250 Views)

Worked perfectly. Thanks for the help 😄

0 Kudos
Message 7 of 7
(12,241 Views)