ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a notepad file to array

Hi,

 

I would like to make a program that can read a Notepad file that I would make. The file consists of 2 colums, 1 column represents the temperature and the other the time.

The program has to read the file and make 2 different arrays, 1 of the temp and 1 of the time.

Does anyone know how I can make this easily??

 

Thanks!

0 Kudos
Message 1 of 8
(4,740 Views)

Use Read from Spreadsheet File.vi from the file palette.  This will give you a 2D array of your data.  Use the Index Array primitive from the array palette to split the two columns.

Message 2 of 8
(4,731 Views)

If you save the file as a plain text file, then Read From Spreadsheet File.vi should do what you want.

 

Lynn

Message 3 of 8
(4,729 Views)

I can read the file with Read from spreadsheet. Buth I can't split it in 2 array's. How do you do it?

0 Kudos
Message 4 of 8
(4,723 Views)

Use the Index Array function to pull each column out of the 2-D array.

Message 5 of 8
(4,721 Views)

Yes I know what you want to say buth how can i program that he first reads the first column and then the second?

0 Kudos
Message 6 of 8
(4,717 Views)

Use the "all rows" output.  That is a 2D array.  Then use the Index Array to get the two columns.

 

Lynn

Message 7 of 8
(4,711 Views)

columns.png

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 8 of 8
(4,708 Views)