scan and parse file contents