I have 3 notepad files in directory , i want to compare 1st file to other 2 and drop the duplicate blocks keep unique output , for Example :
File 1:
User enter email id {
email id:([email protected])
action:enter
data:string }
User enter password {
passoword:(12345678)
action:enter
data:string }
User click login {
action:click
data:NAN }
File 2 :
User enter email id {
email id:([email protected])
action:enter
data:string }
User enter password {
passoword:(12345678)
action:enter
data:string }
User navigates another page {
action:navigates
data:NAN }
File 3 :
User enter email id {
email id:([email protected])
action:enter
data:string }
User enter password {
passoword:(12345678)
action:enter
data:string }
User submit to login {
action:submit
data:NAN }
I want output of file 2 and file 3 is :
File 2 :
User navigates another page {
action:navigates
data:NAN }
File 3 :
User enter email id {
email id:([email protected])
action:enter
data:string }
User submit to login {
action:submit
data:NAN }
Open the first file and make a list of paragraphs
Now open the second file and make a list of paragraphs in the second file and remove the paragraphs that are in the first file
Now write the changes to the second file
Perform the same operations for the third file too
What if there are too many files? We use loops as demonstrated below:
First, create a list of paragraphs
Create a list of all the files that have to be removed duplicates from
Now loop through the list of files and modify them