LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save numeric data from txt file to 1D array

hi
iam new to labview can any one help me with example that how to save numeric data from txt file to 1D array, so that i can use that array in my program
0 Kudos
Message 1 of 13
(4,604 Views)
"Read From Spreadsheet File" in the File I/O functions palette.

Oh, and crack open that LabVIEW manual as well.
Message 2 of 13
(4,590 Views)
Here is a simple example of opening a txt file, reading the file with numbers delimited with a comma, and closing the file.
 
 
Hope this helps.
 
Jae Ho Jeon
 
 
0 Kudos
Message 3 of 13
(4,576 Views)

I don't think above diagram is showing. So here it is again and also as an attachments.

 

Jae Ho Jeon

Message 4 of 13
(4,566 Views)
hi
i am getting this error

One or more required inputs to this function are not wired or are wired incorrectly. Show the Context Help window to see what the connections to this function should be.

please help me.

thanks
0 Kudos
Message 5 of 13
(4,558 Views)
hi
here is the file which i have to read

please help me
0 Kudos
Message 6 of 13
(4,556 Views)
hi
error is corrected but i am not able to store the data

i have included the file to store data from
please help
0 Kudos
Message 7 of 13
(4,556 Views)
You could have saved yourself a lot of trouble and just used the Read From Spreadsheet File like smercurio suggested. You tried to copy the other example but besides not wiring the file reference to open file, you also miswired the close file. The reference has to come from the read file to the close file. Otherwise, you might actually close the file before reading it. That's basic dataflow. You also have the wrong delimiter for the Spreadsheet String to Array. You have to right click on the string constant with the '\n' and select '\' Code Display to correctly use the Line Feed constant. Here's the VI you posted in a working form. I made the changes I mentioned and cleaned up your wiring a bit too. It's never to early to learn how to have a clean diagram with wires going where they are supposed to and routed in a logical manner. You also need to make sure that all of the error inputs/outputs are wired up.
 
I also included the Read From Spreadsheet function. The picture posted will work but I don't see the need for re-inventing the wheel in this case.
Message 8 of 13
(4,547 Views)
thanks
smercurio_fc
and
Dennis Knutson

0 Kudos
Message 9 of 13
(4,543 Views)
hi

Data saved in array in file2array_fixed is not saved permanently when i close the file after saving it is erased, i want data to be saved permanently in array

please help
0 Kudos
Message 10 of 13
(4,531 Views)