I have a file that contains a list like below:
ID: ID_A
attr1: attribute
attr2: name
attr3: city


ID: ID_B
attr1: attribute2
attr2: name2
attr3: city3
attr4: country
the file contains about 60k entries of this sort. The unique identifier is always on the ID line. Once I hit a new ID, I need to be able to retrieve all the attributes for that ID.
I am trying to do the following:
if($line=/ID/../ID)
{
$job[0]=$line
}
but this doesn't work and I also have to create an array that's large enough or small enough every time. Any tips on how to proceed will help very much.
thank you. JS


Check Solution