LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from Spreadsheet Only Reading 1st Column

Solved!
Go to solution

Hi All,

 

I am using "Read from Spreadsheet" to read a file one row at a time (I am going to be using the data from each row for some calculations done on a row-by-row basis).  However, the program is only showing me the cell value from the first column of each row.  I have tried saving my data as a *.csv file and a *.txt file, but it does the same thing for both values.  Any ideas as to what I am doing wrong?


Thanks,


FB

Read from Spreadsheet.png

 

Read from Spreadsheet Front Panel.png

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 15
(8,037 Views)
Solution
Accepted by topic author diarmaede

Attach your file! You are specifying a tab as a delimiter. Is that what you actually have? What is saving the data? Simply changing a file extension does nothing to change the format of the data. Look at the file with a simple tool such as notepad.

0 Kudos
Message 2 of 15
(8,035 Views)

I'm not sure what I did that changed the functionality, but the program now works with the *.txt file.  It still gives me only the first row when I use the file I saved as a *csv file.  In any case, problem solved, but I am attaching text files, per request.

 

Ah!  Now I see where the delimeter input goes, all hidden under the polymorphic text and all.  Thanks!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 3 of 15
(8,028 Views)

Regarding the first row, that is what you are telling the vi to get to you!

Have you looked at the help for this vi, and what the values you have connected to it, is for?

Try to change to blue 1 to something different.

0 Kudos
Message 4 of 15
(8,024 Views)

good answer, see what demiliter is inside the csv by opening it with notepad.

0 Kudos
Message 5 of 15
(7,724 Views)

I have the same problem. The dilimeter in the first few rows is colon then it becomes space (but not sure). I tried using \t, \s, or \: in the read spread function but it alawyes reads the first column. I attached the VI and image for the file because it seems the type of file is not accepted in the forum.

0 Kudos
Message 6 of 15
(7,466 Views)
There is no image of the file.
0 Kudos
Message 7 of 15
(7,464 Views)

Sorrey I forget one of the files

0 Kudos
Message 8 of 15
(7,452 Views)

That is NOT a spreadsheet file.

You are going to have to read in sections of the file and you will have to write code to handle to different sections.

 

You will NOT be able to get the results you want with a single read spread sheet command.

You are going to have to use different parsing methods for the different sections.

Omar
0 Kudos
Message 9 of 15
(7,443 Views)

Read in the whole file into a single string.

 

Search and slit the string at "Dose [cGy] ...

 

Take the before part and parse using the : (not \:)

 

Take the after part and you can use the Spreadsheet String To Array to get the table

 

Note that parsing on the ':' you will find the : 08 as part of the date and :23 as part of the min and :37 as part of the seconds.

 

Omar
0 Kudos
Message 10 of 15
(7,437 Views)