I am trying to remove lines that start with/contain only integers.
So for example this input file:
15
Humpty Dumpty
12
sat on a
5
wall
Should be ouput to a file like so:
Humpty Dumpty
sat on a
wall
I have tried the following:
Basically what I am trying to achieve is to read a line from an input file. If that line starts with integers, remove it somehow and continue to the next line. If a line does not have any integers in it, output it to the output file. I have tried doing this with a for loop to go through the entire string, but it did not work as I thought it would. Anyway, I am stuck and would greatly appreciate any help. Thanks.Code:string line;
while (INFILE)
{
getline(INFILE, line) ;
if(line[0] == '0' || '1' || '2' || '3' || '4' || '5' || '6' || '7' || '8' || '9')
{
line.clear() ;
}