use strict; while () { print if (split ' ')[2] ne 'H'; } __DATA__ ATOM 16 NZ LYS A 7 -19.664 15.558 -9.499 1.00 18.80 N ATOM 17 H LYS A 7 -19.967 21.014 -14.224 1.00 0.00 H