Hi Everyone, retrying c++ after a 10 year hiatus. F/C scientific programmer here :)
So I have this really really long data file. It has a header and I want to locate the heading just before the data rows begin. The heading size may change from different sources, but the heading is always the same. So it's something like
{
long header
}
{column titles = AAA BBB CCC DDD EEE ... ZZZ}
{data columns = 111 222 333 444 555 ... 666}
.
.
.
{data columns = 111 222 333 444 555 ... 666}
I got my proggy to read each line and find the first word of the header and check it and then begin reading data...using:
getline(snp_file_in, word, ' ');
but I want to output the header also...but I realized that using
getline(snp_file_in, line);
moves my buffer...
is there a way to rewind the stream pointer? All the examples for peek use characters and I need at least three characters to check if I've reached the heading....and I need to read and output the header.