Filter data from file config?

I have file as attached.
Data09.xlsx (11.0 KB)

Sheet config (Set number column in file input) as below.
image
Sheet Config

I want to read sheet config for filter sheet input that column3 (type) = RE.
image
Sheet input

After filter I want write data in sheet output (write column2=Name , column3 = Type) as below.
image

Please guide me about it.

1 Like

Hey @fairymemay

I’m sorry, Unable to understand it clearly.

There is something you need to filter which is fine, do you want to filter based on the config sheet input ?

Please elaborate

Thanks
#nK

@Nithinkrishna New file as attached.
Data09.xlsx (13.8 KB)

Yes, I want to filter based on the config sheet.

image

From sheet config
Col_No = column number 1 (Column A in sheet input )
Col_Name = column number 2 (Column B in sheet input )
*I create file config because If I change name column —> Not error & easy for edit.

I want filter type (Column3, Column C) = RE. —> write data that match to file output

Sheet Input as below.
image

(Write data in Column1, Column A —> Name & Write data in Column2, Column B —> Type)

Sheet Output as below.
image

Please guide me about it.

1 Like

FilterExcelData_09012022_1517.zip (11.3 KB)

Please find the attached solution. Hope this will be useful.

Kindly check the logic if you can understand it. If not please let me know.

Thanks
#nK

@Nithinkrishna No, I want use column number instead of column name.
image

(Column Number 1 = Column A , Column Number 2 = Column B , Column Number 3 = Column C , …)

Please guide me about it.

1 Like

Hey @fairymemay

That requires a small change, which is done in the below attached zip.

FilterExcelDataByColNos_09012022_1517.zip (12.3 KB)

Hope this helps.

Thanks
#nK

1 Like

@Nithinkrishna I have question.

My File as attached.

File Input : Data09.xlsx (14.2 KB)

File output : output91.xlsx (9.5 KB)

File Report : Report.xlsx (8.8 KB)

If I add requirement as below.

  1. If file input have more 2 sheet , I want read loop all sheet in file input (Except sheet config , invisible sheets) filter type = RE and write data in new file output and create name sheet follow input sheet.

File Input

Sheet Config as below.
image

  1. I want map data addition in file output with File Report and write in file output.

Sheet Output as below.

It have 2 sheet (Follow input file)

Please guide me more about it.

1 Like

Hey @fairymemay

You need to just loop through the files,

  1. Directory.GetFiles will help you to get all the files from the input directory for processing

  2. Loop that file collection (from Step1) using a for-each loop

  3. Inside the for-each loop just add the logic which we already built by replacing the hardcoded file path with the for-each loop item

Thanks
#nK

@Nithinkrishna I​ understand​ 1.​ But I don’t understand i​n​ 2,3.

Please guide me​ more.

Thank​ you

1 Like

FilterExcelDataByColNosForMultipleFiles_09012022_1517.zip (34.8 KB)

Here I have updated the code to handle multiple sheets.

You can customize it as required.

Hope this helps.

Thanks
#nK

@Nithinkrishna

Yes, But I don’t understand how to map data as below. (Map column Summary with Type)

image

  1. I want map data addition in file output with File Report and write in file output.

Sheet Output as below.

Please guide me more about it.

File Input : Data09.xlsx (14.2 KB)

File output : output91.xlsx (9.5 KB)

File Report : Report.xlsx (8.8 KB)

1 Like

Hey @fairymemay

You need to just add summary column to the output right ?

Thanks
#nK

@Nithinkrishna yes

1 Like

Please check the filter DT activity & add the extra column over there similar to how we added other columns

@Nithinkrishna In this right?

1 Like

@fairymemay

Yes, Perfect. You are in the right direction.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.