Python Forum
Matching between two files + using next()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matching between two files + using next()
#2
Hi,

What i would do is read all of the file2 identifiers into a list (using append).
You will end up with something like identif = ['1111', '2222','3333',...]
Close file2.
Now you read file1 line per line and iterate over ident[...] to look for a match.
It is not clear to me from your data, if 2 lines below there is another identifier match,
or what is is you want to do next.

Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
RE: Matching between two files + using next() - by DPaul - Jun-18-2020, 06:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Finding files matching pattern GrahamL 1 1,335 Jan-14-2022, 01:16 PM
Last Post: DeaD_EyE
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,585 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  Matching two files based on a spited elements tester_V 5 2,863 May-30-2021, 07:49 PM
Last Post: tester_V
  How to get full path of specified hidden files matching pattern recursively SriRajesh 4 4,012 Jan-18-2020, 07:12 PM
Last Post: SriRajesh

Forum Jump:

User Panel Messages

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