hi.
i have 26/01/10 09:20:20 MAL BIN BIN275 TSTCB U8L5 O/CR ..N UCOS Operated
in string
i want to extract column 36 into 60 that is
BIN275 TSTCB U8L5 O/CR
the last output i want to include
O/CR
is there any simple solution to settle this? already make this but not work.
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
FILE * pFile;
char mystring [100];
int string_length;
ofstream output;
pFile = fopen ("input.txt" , "r");
output.open("output.txt", ios:: out);
fgets (mystring , 100 , pFile);
puts (mystring);
string_length = strlen(mystring);
int i=36;
while (i < 60)
{
output<<mystring[i];
++i;
}
fclose (pFile);
output.close();
return 0;
}
thank you