My method for figuring out what was what was not to click on them, as that was time-consuming. I'd just collect them on the wagon until the wagon could hold no more. Then I'd use a hack program (DFhack, I think, but I can't check now) to view my inventory. I'd note the ones I wanted to keep (if any), then get back in the game and drag everything off the wagon I didn't want, then just dump it in the hallway outside the dungeon exit. Exit the dungeon, re-enter, repeat. If you're level-grinding anyway, you can do that too.