How to compare text file with excel file

Hi Team,

How to compare text file with the excel file.

Excel file Values:BG000011,BG000022,BG000033…

If excel file values matches with any line of text file,copy the total line of data in to another text file.
Appreciate your immediate help.

Regards,
Rajesh

Firstly Take those excel values in a variable
then for text file split it by new line
then using If condition in For each of splited data u can compare…

1 Like

Hi,

Check this xaml, I have placed the excel and textfile on my desktop then tried with the xaml.

I have created my own excel file since I do not have idea on your file format. ReadExcelAndCheck.xaml (7.6 KB)

Book1.xlsx (9.5 KB)

1 Like

Hi @sarathi125,

Thank you for the response,
I have changed the files path based on your xaml and tried with your xaml but its copying the whole data from text file.
I need to copy the excel data matching lines to be copied in to new test file.
Also in desktop 3 files are copying.May i know why?
New,New1 and New2 files >

Attached the exact files for reference.AgentData_Disbursement_UnsuccessfulAgents.xlsx (8.5 KB) TextFile.zip (769 Bytes)

Regards,
Rajesh

For each string from the excel we are creating a new files, thats why you are getting three files on your desktop.

Thank you for the response sarathi. @sarathi125
My requirement is to check in text file whether the excel values is matching in any of the text file,if yes then copy the total line.

Regards,
Rajesh

Expected output i have attached.TextFile Output.zip (599 Bytes).

I want to add data in one file same as attached.

ReadExcelAndCheck.xaml (10.3 KB)
Check the updated workflow and let me know in case of any query

2 Likes

This is Perfect!!
Thanks a lot @sarathi125.
Appreciate your time!!

Hi @sarathi125,

Need small change,can we keep header and footer as same using same code.

Regards,
Rajesh

Do you mean this “UnsuccessfulAgents” as the header and which one is the footer?

Summary file header and footer needs to add.

ReadExcelAndCheck.xaml (11.2 KB)

Check this workflow, I assume always the footer will be your last line in the summary text file.

Hi @sarathi125,

Header is fine but footer is missing when i use huge file to compare.
Could you help why footer is missing.

Sorry for late reply,as i am out of office.

Regards,
Rajesh

Hi @sarathi125,

When i use summary file with less records footer is adding but when i use summary file with huge(More than 50000 records) footer is missing.
How to overcome this?

Thank you,
Rajesh

Hi,

Check with the footer and header activity like this,

Capture

1 Like

Thank you @sarathi125,

This is working perfect !!.

Regards,
Rajesh

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