Python Forum
Organizing the output of 2 for loops
Thread Rating:
  • 2 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Organizing the output of 2 for loops
#2
The first question that pops into my mind is: Why isn't that a database? :D
But nonetheless, since your last column is somehow a key for your output (both tables share it and it is individual for each table) read in the first file and create a dictionary where the 6th column is the key and the other elements are stored in a list which is the element for the key of the dictionary, so that when you read the second file you can search for the key and extend the list by the given new elements. the only thing left to do is to prettify the output :)
Reply


Messages In This Thread
Organizing the output of 2 for loops - by pythoneer - May-19-2018, 04:53 AM
RE: Organizing the output of 2 for loops - by ThiefOfTime - May-19-2018, 08:55 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020