Parse words and write them in output file