>>601
while(fgets(str,256,fp) != NULL){;
  char *f = strstr(str, ch);
  if( f != NULL )
    *f='\0';
  fprintf(fout, "%s", str);
  if( f != NULL )
    fputs(++f, fout);
}