Properly parsing text in result file