in reply to How do i extract records from a file containing a certain keyword in 1 field?

That depends on the type of file and the type of fields.

Please show some data and the code you've tried, so we can help you.

as a very general hint, see:

perldoc -f index perldoc -f sort perldoc perlre
-- Joost downtime n. The period during which a system is error-free and immune from user input.