/////////////////////////////////////////////////////////////////////////// /* Copyright 2001 Ronald S. Burkey This file is part of GutenMark. GutenMark is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GutenMark is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GutenMark; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Filename: NoDups.c Purpose: Eliminate duplicate lines from a sorted ASCII file. Mods: 12/18/01 RSB Began. */ /////////////////////////////////////////////////////////////////////////// #include #include char s[1000], ss[1000]; int main (void) { while (NULL != fgets (s, sizeof (s), stdin)) if (strcmp (s, ss)) { printf ("%s", s); strcpy (ss, s); } return (0); }