Reading into a string

I need to read part of a line into a string and then skip to the next line and read in again and keep doing this until the end of file. the files look like this:

070101_rpts_hail.csv
070102_rpts_hail.csv
070103_rpts_hail.csv
070104_rpts_hail.csv

and I only need the six numbers in the beginning of every line. They are going to be stored into an array of string.
Last edited on
std::getline(file_stream,string);
but I only want the first six numbers and none of the rest
Get the entire string, then just take the first 6 number/characters out of it.
ok how do you do that
substr(0, 6); or 0,5 can't remember check the string reference.

http://www.cplusplus.com/reference/string/string/substr/
Last edited on
Thanks for the very quick responses. I can always rely on the help of the community. Also this worked great it will speed up my project greatly.
Topic archived. No new replies allowed.