i'm new to python, i want to generate results by comparing two files(txt/xls)line by line as Pass or Fail. i was able to achieve this using difflib and htmldiff(). comparison works fine but not able to add third column as results which should return pass/fail for corresponding line. can any one help me with this?

Note: number of lines in files are not equal.

Recommended Answers

Can you give us an example of your code?

Jump to Post

All 2 Replies

Can you give us an example of your code?

import difflib
fromfile = "Engine_Result.txt"
tofile = "Fiery_Result.txt"
fromlines= open(fromfile, 'U').readlines()
tolines= open(tofile, 'U').readlines()
file = open("Results.htm", "w")
if d:
result =d.make_file(fromlines, tolines, fromfile, tofile)
result =d.context_diff(fromlines, tolines,fromfile,tofile)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.