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: 

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
(8,517 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
(8,508 Views)

Here is an example csv 

0 Kudos
Message 3 of 7
(8,495 Views)

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

0 Kudos
Message 4 of 7
(8,491 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


GCentral
0 Kudos
Message 5 of 7
(8,477 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
(8,474 Views)

Worked perfectly. Thanks for the help 😄

0 Kudos
Message 7 of 7
(8,465 Views)