LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read multiple excel files from folder

Solved!
Go to solution

Hello,

 

I have a folder with around 500+ excel files. I want to read certain part of excel file from different cell. This is test report generated in excel file. The serial number is at cell (15,1) and test values at 39,5 Row,col) like that. So it is difficult to open each file and copy the board serial number and measurement value to make board wise single report. Hence i developed the below code but it is not up to the requirement. So kindly share your feedback and idea about it. 

 

Maheboob_0-1717175866153.png

 

0 Kudos
Message 1 of 28
(1,631 Views)

Without knowing the format of your Excel file, it is very difficult to make suggestions.  At a minimum, you should attach a "sample" Excel file, and using that as an example, tell us what data you wish to extract, and what you would like to do with those data.

 

Are you going to be gathering the same data from the same location across all 500+ WorkBooks?  Will the data always be in the same Excel cells?  The code that you attached seems to have little relevance to your description of the task (you mention a serial number at cell (15, 1), but there are no such cell addresses in the code -- you also mention something about "test values at 39,5 Row,col)" which also makes no sense).

 

There is no problem "reading multiple excel files from a folder" -- you specify the folder, specify how to find the Excel files in the folder (presumably processing all .xlsx files?), and what to do with each individual file (are all the data in exactly the same cell location(s)?).  Are you processing "within each file" (i.e. using the data found in a file to update other data in the same file) or "across all files" (i.e. basically reading each file, and then writing something that incorporates all of the data, not necessarily in Excel format)?

 

It is hard to make suggestions when we don't know what the question/problem is.

 

Bob Schor

0 Kudos
Message 2 of 28
(1,599 Views)

Hi,

I attached for your reference.  In folder there are many excel files. So from each file data should be extracted and copy required format. I want to create LV.

 

 

 

Maheboob_0-1720781621725.png

 

0 Kudos
Message 3 of 28
(683 Views)

This might get you started.

 

CSV files can more easily be read using Read Delimited Spreadsheet.vi

 

snip.png

0 Kudos
Message 4 of 28
(673 Views)

Hi,

 

Thanks. Can you describe the label for below image. I am learning LV and don't know most of the names by pic. 

0 Kudos
Message 5 of 28
(669 Views)

Hi Maheboob,

 


@Maheboob wrote:

Hi,

 

Thanks. Can you describe the label for below image. I am learning LV and don't know most of the names by pic. 


Ramon included a snippet in the message, so you can download the snippet and place it in your block diagram!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 28
(664 Views)

Thanks. What is the first Vi name. Other VI's Build path, Read delimited sheet, Index array and last build array

0 Kudos
Message 7 of 28
(658 Views)

Hi Can you let me know what is last Vi with Table name. 

0 Kudos
Message 8 of 28
(648 Views)

@Maheboob wrote:

Hi Can you let me know what is last Vi with Table name. 


I'm not sure what you mean exactly so I might as well attach the VI.

Message 9 of 28
(640 Views)

Hi Maheboob,

 


@Maheboob wrote:

What is the first Vi name.


It's a file function, so look for it in the file functions palette!

 


@Maheboob wrote:

Can you let me know what is last Vi with Table name.


This is just an indicator!

I guess you just started with LabVIEW, so you should open the LabVIEW options, change to "Block diagram" tab and switch OFF the "place front panel terminals as icons" option…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 28
(635 Views)