taking input from a file

I have a file with the following data(each data type separated by a tab space)

file name: test1.txt
start-

supercontig10.2 supercontig10.2 2344 2 232 283829183 119930293 439582190 564429531

supercontig10.3 supercontig10.7 2199 21 455 221193049 458922485 219304949 157684932

-end
I am using ifstream fin("test1.txt") to open it and read from the file. I am facing problems with reading the "supercontig10.2 supercontig 10.2 and supercontig 10.3 supercontig 10.7" part of the data as the one is a mix of char and float type. I dont know how to get done with this.

In my program, I will have to compare the first two parts of a line and exclude all the lines that have the first and second part as the same i.e., I will have to exclude the total first line in the file and consider only the second line. Please reply how to compare the first two parts in each of the lines.
For reading in the first two parts, you could use an std::string. If you are storing the data in an std::map, then it should be easy; just use the [] operator to create/replace elements.
Topic archived. No new replies allowed.