My input file (~5k lines) format looks something like this
foo0: users/user1/temp1 users/user2/temp1 4.0
foo1: users/user2/temp1 users/user4/temp2 users/user4/temp1 1.0
foo2: users/user1/temp3 users/user2/temp3 2.0
foo4: users/user4/temp5 users/user2/temp6 users/user1/temp1 users/user3/temp1 4.0
What my script needs to do is to look at each line, grab each of the paths, open file & check something inside based on it.
For ex: For line 1, the script has to open user1.txt and search for temp1 inside user1.txt and do something. Then go on to user2.txt and look for temp1 inside and do something.
For line 2: Open users2.txt and search for temp1; open users4.txt and search for temp2; open users4.txt and search for temp1.
What’s the quickest way to go about it. I currently open and close one by one, and that seems to take a long time. Any help appreciated, thanks!
I would do something like this: