Hello all,
I have a text file called: concentrations.dat
The file contains a lot of different data. Here's the data that I'm interested in:
# ET: list of elements
<ET>
'Cu' 'C' 'Sr' 'He' 'Mg' 'O' 'Cr'
What I want to do is read the elements into a vector called elementVector. So I would end up with Cu, C, Sr, He, Mg, O, and Cr as elements of the vector without the ' symbols.
Can anyone tell me how to do this? An example would be much appreciated. I have had no success with using ifstream. I can read in an entire file, but I can get parts of it out!
I could either read in the entire file or only read in the part that I wrote above. Then I would need to get the elements, while discarding the ' symbols.
I need to do this because I have written a program for doing calculations that needs to know which chemical elements are involved.
Thanks for any help.