Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: CCC Database Tool

Author: Dann Corbit

Date: 15:25:22 08/10/00

Go up one level in this thread


/*
** If you use CCCDBNAV, use this to pre-clean your data:
** It's a lame hack, and assumes ASCII character set.
** Caveat emptor.
*/
#include <stdio.h>
int
main (void)
{
/*
   3. remove TAB symbols from ccc.db (I include retab.exe for this)
   note: you have to do it with all new messages, while adding to ccc.db
   4. some earlier archives can contain EOF (1Ah) symbols, and 0D0D0A
   sequence instead of CR+LF, you must remove these inconveniences if
 */
  int c;
  FILE *foo = fopen("ccc.db", "rb");
  while ((c = getc(foo)) != EOF)
    {
      if (c == '\t')
        {
          putchar (' ');
          putchar (' ');
          putchar (' ');
        }
      else if (c == 0x0d)
        {
          ;
        }
      else if (c == 0x0a)
        {
          putchar ('\n');
        }
      else if (c == '\n')
        {
          putchar ('\n');
        }
      else if (c == 0x1a)
        {
          ;
        }
      else if (c < 32)
        {
          ;
        }
      else
        putchar (c);
    }
  return 0;
}



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.