code to search files and extract