So I've got two CSV files that I'm trying to compare and get the results of the similar items. The first file, hosts.csv is shown below:
Path Filename Size Signature
C:\ a.txt 14kb 012345
D:\ b.txt 99kb 678910
C:\ c.txt 44kb 111213
The second file, masterlist.csv is shown below:
Filename Signature
b.txt 678910
x.txt 111213
b.txt 777777
c.txt 999999
As you can see the rows do not match up and the masterlist.csv is always larger than the hosts.csv file. The only portion that I'd like to search for is the Signature portion. I know this would look something like:
hosts[3] == masterlist[1]
I am looking for a solution that will give me something like the following (basically the hosts.csv file with a new RESULTS column):
Path Filename Size Signature RESULTS
C:\ a.txt 14kb 012345 NOT FOUND in masterlist
D:\ b.txt 99kb 678910 FOUND in masterlist (row 1)
C:\ c.txt 44kb 111213 FOUND in masterlist (row 2)
I've searched the posts and found something similar to this here but I don't quite understand it as I'm still learning python.
Edit Using Python 2.6