#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fstream>
using namespace std;
int main(int argc,char** argv)
{
cout<<"argc = "<<argc<<endl;
for(int i = 0;i<argc;i++){
cout<<"argv["<<i<<"] = "<< argv[i]<<endl;
}
const char* filename = "text.srt";
const char* fswname = "newText.txt";
fstream fs(filename,std::fstream::in);
fstream fsw(fswname,std::fstream::out | ios_base::trunc );
fs.seekg(0,fs.end);
int lengthFS = fs.tellg();
fs.seekg(0,fs.beg);
string strbuf ="hello";
while(fs.tellg() != lengthFS){
getline(fs,strbuf,'\n');
if(strbuf.find("-->") == string::npos && strbuf.length()>3){
cout<<strbuf<<endl;
fsw<<strbuf<<endl;
}
}
fs.close();
fsw.close();
return 0;
}