string search and copy in a file !
Hello,
I have a text file which contains this...
Mass Flow Rate = 1.06984
Total Press Ratio = 1.05424
Adiabatic Efficiency = 0.730169
Exit Flow Coeff Cr2/U2rms = 0.438395
Ps2/Pa = 0.990686
i want to seach for this "Adiabatic Efficiency = 0.730169" and print it.
this is my code
Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
void main()
{
string c;
ifstream reads("R0_1st.txt");
reads.seekg(ios::beg);
reads.unsetf(ios::skipws);
while(!reads.eof())
{
getline (reads,c);
cout<<c<<endl;
}
}
this code prints all the file
i just want to seach for the string before i print
Thanks