robot parade I got the scripts running. and what do the use warnings/strict do?
your script is very close, only problem I see is when the field with the '-' in it is the first one for that ID it still includes it. this wouldnt have shown up using the little example dataset I provided.
I'm thinking that the way to go may to be have 2 different scripts. one that just deletes the rows with '-' in the query field. then after running it I run the one that my prof wrote to cluster it.
heres a link to where I downloaded the datasets from originally.
http://www.gregsadetsky.com/aol-data/ its a really interesting dataset just to open up and look at and see what people are searching for.