Hi,
I want to read the data from excel files which is placed in a folder(the folder contains 30 excel files),
here i want to check the data in each excel file by using date or some id(if any of the excel file contains the data related to what i have searched is to be written into another excel file).
You need to use Directory.GetFiles(“FolderPath”,“File Extension”), this will give you an array then you can apply for each loop on it and perform operations on each file
@PrankurJoshi
Ok,
It will ask for sheet name of excel file,is it possible to read excel file without sheet name.
Its not possible to read the excel without sheet name. You can get the sheet name by creating Workbook variable in Excel Application Scope
Here it is -
Main.xaml (8.0 KB)
Sample.xlsx (8.8 KB)
this will give you sheet name then you can use Read Range with this
@PrankurJoshi
That works,but for me i have excel workbooks in a folder(30 excel books) and 30 excel workbooks have different sheets with different names,now i have to read specific data from excel workbooks(such as based on date or id’s) for this i have to check each workbook in the folder with sheet name.
How can i get this,can u please help on it.
Here is the example which would pick each excel file in the folder path given and for each excel file operations can be performed by Excel Application Scope
Main.xaml (10.2 KB)
Excel Files.zip (30.6 KB)
@PrankurJoshi
Hi,
Is it possible to read the data in excel files in your folder instead of reading sheet name.
We read the sheet name because the sheet names for so many files can not be known. yes you can read the data by using Read Range activity in same workflow
@PrankurJoshi
ok,in the reading excel file if the repeated values are coming,it is showing an error
“A column named (some value) is already belongs to this data table.”
Is there any solution for it.
Column names should be distinct. For removing duplicates you can use Remove Duplicate Rows activity
you want to read ex1.xlsx to ex5.xlsx right? and After reading?
@PrankurJoshi
Yes,It is the sample files.
But in my original data there is no column names for it.
what do you want to do after reading files?
@PrankurJoshi
I have to write each file into an excel file with some column headers(A1,A2,A3,A4)like that.
@PrankurJoshi
ok,
But in read range activity,i don’t want to specify sheet name,
is it possible to read data without specifying sheet name.
And also i have to write each excel file data into the separate excel file.(i don’t want it to be in single excel file).
You will have to specify sheet name for read the file. Yes you can have the dynamic file name in excel application scope write range that will allow you to save files with different names