As per the above, in file2 last line is missing and that should be printed out.
And then in file2 3rd line is modified which should be printed(example: zxcv is modified as zubncv)
And if new line is added in file2, that should be printed.

I really don't understand what you wanted. If you want to comapre and print out line in file1 that is missing in file2 then this is NOT how you want to do it.

To start with, your code will not run as it is.
So am suprised that you said you have an output in the first place. In the code above, the open function line. You are supposed to use 3 option arguments type of open, but you had 2.

2nd line ie, "neece,OU=Imported,dc=Faculty,dc=asdf,dc=org" is deleted. This should be printed in deleted list.
New line ie, "andrews,OU=Imported,dc=Faculty,dc=asdf,dc=org" is added in file2. This should be printed in new line added list.
allyson is updated to James in file2. Which should be printed in updated lines list.

Working out the difference between two files is trivial using (like I said earlier) diff and comm, both of which have existed since at least the 1970s.

The two provided files, diffed by word. Red bits have been removed, green added.

Now, comm outputs three columns

lines only in file 1

lines only in file 2

lines in both files

So by default, lines that were deleted in file 2 will be in column 1, lines that were added in file 2 will be in column 2, and lines that remain unchanged will be in column 3. You can surpress columns using -1, -2 or -3, so we can run the command multiple times to get a nice summary.