in reply to Print only the matched line when process line by line from a file
Please, when you cross-post on different sites, it is considered polite to inform all locations that you've done so.