I had a similar problem searching data files. It turned out that there were some extra lines in the raw data file that went beyond the data.