/* john pfeiffer 28feb09 20 min prog, take in file, only write that which is not between < or >
works fine after convertlit program makes a mess off a lit -> but still need to convert #123124 items
*/
#include <stdio.h>
#include <stdlib.h>
void readuntilchar( FILE* ifp, char stopchar)
{
char c;
do{
c = getc(ifp);
}while( (c != EOF) && (c != stopchar) );
}/* end function readuntilchar */
int main(int argc, char* argv[])
{
char c;
FILE* ifp;
FILE* ofp;
ifp = fopen(argv[1],"r");
ofp = fopen(argv[2],"w");
if( ifp == NULL || ofp == NULL )
{ printf("error opening file\n");}
else
{
do{
c = getc(ifp);
if( c == '<')
{ readuntilchar( ifp, '>');
}
else
{ putc(c, ofp);
}
}while( (c != EOF) );
fclose(ifp);
fclose(ofp);
}
return 0;
}