From 9306cb60c32082c5403931de0823a9fd5daa196c Mon Sep 17 00:00:00 2001 From: Jason Katz-Brown Date: Sun, 25 Aug 2013 02:17:13 -0700 Subject: Initial git commit. --- makeswelexicon/rmline.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 makeswelexicon/rmline.c (limited to 'makeswelexicon/rmline.c') diff --git a/makeswelexicon/rmline.c b/makeswelexicon/rmline.c new file mode 100644 index 0000000..b218a5b --- /dev/null +++ b/makeswelexicon/rmline.c @@ -0,0 +1,27 @@ +// first argument: filename of list of line numbers to delete. files start with line 1. +// stdin: input file +// stdout: output file +// dqplz@yahoo.com / 5 Aug 2008 +#include + +main(int ac, char *av[]) +{ + FILE *in; + + int line=1; + int del=0; + int rc=0; + unsigned char iw[100]; + if((in=fopen(av[1],"r"))==NULL) { + fprintf(stderr,"%s: can not open '%s' for reading\n",av[0],av[1]); + rc=1; + } + else { + while(fgets(iw,sizeof(iw),stdin)!=NULL) { + if(del==0||del