IBM Interview Question

how to write a script for extracting specific pattern in flat file.