I'm currently learning fstream and I am trying to search a txt file I created for certain strings.
Once I find a string I want to start copying the strings directly under them until I find another string to begin the copying directly under them. Except for my first string I want to copy after the "=" sign then stop after a new line.
For example the txt will look something like this:
R = 1-1
cbl
12
14
16
18
R = 2-1
cbl
11
13
15
17
where R equals the remote number. Cbl means the cables and under "cbl" is the cable numbers (none are going to be integers all are strings).
But I want the out put to be in the format
1-1 12
1-1 14
1-1 16
1-1 18
2-1 11
2-1 13
2-1 15
2-1 17
The reason I am creating this searching and outputting program because once it is in my final format, I plan on inputting them into excel to be placed into a database.
I can open the file but I have no idea how to search word for word and then tell the program to copy next to key words then continue until another keyword.
Help?