nach einer best. Zeile in einer Datei suchen und filepointer dahin positionieren
-
Hallo,
Ich suche nach einem best. String (Zeile) -> acStart in meiner Dateie -> pprocess. Länge einer ZEile RECORD_LEN (konstant)
while(!feof(pprocess)){ fgets(acTmp,RECORD_LEN+1,pprocess); if(0==strcmp(acTmp,acStart)){ fgetpos( pprocess, &pos ); fseek(pprocess,pos-(RECORD_LEN+1),SEEK_SET); break; //found } }
und setzen den filepointer dahin..
Gibt es noch eine elegantere lösung wie meine? glaube sicher ja;)