The strange thing is that the code works just fine if I put it in a while loop. It does not skip the getline. So I googled it and added inputFile.clear(); but it still skips. I will keep googling. If you have another suggestion, I would be pleased to read it.