LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read excel sheet

Solved!
Go to solution

What I should use in this block , I have tried read excel but I did’nt know how I could get this type data

I am attaching a excel file which is in CSV format. and DATE .doc in which excel data is 

 

and a doc. file in which .

 

please see it and help me 

 

thanks in advance

Download All
0 Kudos
Message 1 of 13
(5,014 Views)
  1. Your Excel file is NOT a CSV file. It's a binary file. Smiley Mad
  2. Your question is not clear. If your columns have mixed data types, like one column is numeric, another column is string, and another column is some form of date, then you need to read the sheet as a 2D array of strings and then convert each column as necessary. Unless you absolutely must have the code interface directly with an Excel workbook it will be far easier if the data is saved as a text file. Like a real CSV file. Then you can just use Read From Spreadsheet File to get your 2D array of strings. If you absolutely have to access an Excel workbook you can find a simple example that will read an Excel sheet into a 2D array of strings.
0 Kudos
Message 2 of 13
(5,004 Views)

Can any one please help me out. Iam in need of a labview code which has a excel sheet consists of 

 

3 columns

1) DATE  

2) TIME

3) TEMPERATURE value.

 

If a string is entered as a input and that string should be compared with the Names under DATE AND TIME column in the excel sheet and if the string entered matches with any of the string under the DATE AND TIME column then it should pass one output

 
1) The value of that string 
 

 

For example if Iam entering the i/p as 10/7/2012  03:55:05 PM then it should search the strings under DATE AND TIME tab and if row 8 as the 10/7/2012  03:55:05 PM string with a value of  461.106 then it should return two o/p's one as 461.106  

 

If the entered string is not matched  with any of the strings under DATE AND TIME coulmn it should return an output as zero.

 

i am attaching a excel sheet screen shot which is in csv format

 

Thank You

0 Kudos
Message 3 of 13
(4,986 Views)

It would be much better if you could post the ACTUAL file you are trying to read instead if the data copied into word (first post) or a screenshot of the data opened in excel (second post) that way we would know exactly what type of file you are trying to read.

 

Ken 

0 Kudos
Message 4 of 13
(4,975 Views)

Can any one please help me out. Iam in need of a labview code which has a excel sheet consists of 

 

3 columns

1) DATE  

2) TIME

3) TEMPERATURE value.

 

If a string is entered as a input and that string should be compared with the Names under DATE AND TIME column in the excel sheet and if the string entered matches with any of the string under the DATE AND TIME column then it should pass one output

 
1) The value of that string 
 

 

For example if Iam entering the i/p as 10/7/2012  03:55:05 PM then it should search the strings under DATE AND TIME tab and if row 8 as the 10/7/2012  03:55:05 PMstring with a value of  461.106 then it should return two o/p's one as 461.106  

 

If the entered string is not matched  with any of the strings under DATE AND TIME coulmn it should return an output as zero.

 

i am attaching a excel sheet screen shot which is in xls format

 

Thank You

0 Kudos
Message 5 of 13
(4,969 Views)

Looks like this .xls file began life as a .txt file, was opened in excel and saved as an excel file.  If this is the case it would be better if you worked on the original text file as this is easier to read into LabVIEW using 'Read From Spreadsheet File' as smercurio-fc has already said.  Once the data is in LabVIEW it is straightforward to search the 2 D array for the input DATE and TIME values you enter and return the temperature at this point.

 

You can convert it back to a true .csv (text) file by doing Save As in excel and selecting CSV in the Save as Type combo box (under File Name) in the Save As Dialog.

 

Ken 

0 Kudos
Message 6 of 13
(4,964 Views)

This VI should do what you want.  I warn you it is not very elegant and there are better ways to enter (and validate) the data to search for but its a starting point for you.

 

Ken

 

PS it's in LabVIEW 2011 - If you need it in an earlier version of LabVIEW then let me know

 

0 Kudos
Message 7 of 13
(4,957 Views)

Have a Look

 

This will resolve your issue

 

Hello Ken

 

Using spreadsheed function you cant read the EXCEL file. The file is developed by spreadsheed function that only you can read using spreadsheed fuction.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 8 of 13
(4,951 Views)

 hi    Ken Naylor

 

thank you for sending me this labview program

 this is working but i need this vi for 2010 labview 

 

please send me this in 2010 version

 

thanks in advance

0 Kudos
Message 9 of 13
(4,914 Views)
Solution
Accepted by topic author garg1989

Here is the same in LabVIEW 2010 (I have added a array indicator to show the data loaded from the file)

 

Ken

0 Kudos
Message 10 of 13
(4,911 Views)