I have a CSV that looks something like this. The list will typically contain about 10-50 lines:
HASH FILE USER HOST
1C7E2110A55F42F525E196499FF88523 ABC.EXE TEST1 XYZ
3B7E2110A55F42F525E196499AA88421 124.TXT TEST2 SDF
I have a tuple previously defined in my script with two values in each set. The first containing a hash and the second containing another number. For example:
hashes = [('1C7E2110A55F42F525E196499FF88523', '4'), ('5A7E2110A55F42F525E196499FF88511', '89')]
I am trying to figure out how to compare my hashes tuple to my CSV, then add another column named "NUMBER" that populates with the second value in the tuple for any hash values that are both in my original CSV and my hashes tuple. I can figure out how to add another column to the CSV, but populating it with the proper data from my tuple is where I am hung up. So for the above examples, I want my final CSV output to look like this... granted, the CSV and tuple will be larger, but as an example:
HASH FILE USER HOST NUMBER
1C7E2110A55F42F525E196499FF88523 ABC.EXE TEST1 XYZ 4
3B7E2110A55F42F525E196499AA88421 124.TXT TEST2 SDF