I asked a question yesterday (http://rdsrc.us/JU6UCg
) which was answered but I think I need to go back and start at the beginning.
I have a text file with two columns like follows (the real file has c.100k lines)
I then have a second text file that has one column of data as follows:
I want to loop round this second file and using the ID lookup the corresponding line in file1 and return the value in column. I need to loop it as one the value is retrieved I need to do further processing on it, but that’s outside this question.
Note that in file1 the data in the first column isn’t unique - where more than 1 match is found, I want it to return a null (i.e undtermined)
So, given the IDs in file 2, I would want to retrieve:
How do I properly read file1 into a hash and then lookup values in it whilst looping through a second file?