                               NASAWASH
            NASA-Format Keplerian Element Set File Cleanup

Updated 13 August 1996
Updated 26 September 2002 (doc only)

Copyright 1995 Paul Williamson, KB5MU.  All Rights Reserved.
You may use this program freely for non-commercial purposes.  This
program may be distributed freely, provided that it is distributed
without modification and with all the associated documentation files.

NASAWASH extracts valid NASA format 2-line Keplerian element sets
from a text file, which may contain other text of various kinds.  It
is intended to remove the miscellaneous text commonly added by
network e-mail and bulletin transmission.  It can remove lines of
text before, after, or between element sets, but not between the
lines of a single element set.  It can remove text on the same lines
as the element sets, before or after the element sets, provided that
the three lines of the element set all begin in the same column.

NASAWASH insists that the element sets contain valid checksums, but
it will accept either of the two common checksum algorithms in use.
The element sets output by NASAWASH contain no "+" signs, so they
will be accepted by either checksum algorithm.  Except for the format
and the checksum, NASAWASH does not attempt to interpret the element
set.

NASAWASH doesn't care what end-of-line terminators your input file
uses, so you don't need to worry about converting between Unix (LF),
MS-DOS (CR+LF), or Macintosh (CR) formats.  The output file always
uses the standard convention for text files on your system.

RUNNING NASAWASH
================

NASAWASH can be run in three different ways:

  1. As a "filter", NASAWASH takes its input from the standard input
stream, and writes its output to the standard output stream.  This
is useful when NASAWASH is used as part of a pipeline of programs.
For example, if you have a program called getdata that extracts text
from a network somehow, and a program called usedata that needs pure
2-line element sets as input, you can use the following command line:

  getdata | nasawash | usedata

You can also redirect the input and output streams manually using files:

  nasawash <infile >outfile

  2. As an output generator, NASAWASH takes its input from a file
(specified on the command line) and writes its output to the standard
output stream.  This is useful when NASAWASH is used as the beginning
of a pipeline of programs.  For example:

  nasawash infile | usedata

You can also redirect the output manually using a file:

  nasawash infile >outfile

  3. As a standalone program, NASAWASH takes its input from a file
and writes its output to another file.  Both file names are specified
on the command line.  For example:

  nasawash infile outfile


In the last two modes, NASAWASH generates a message indicating how
many valid element sets it found.  This message is not generated in
filter mode.  If NASAWASH is unable to open either file specified on
the command line, it will issue an error message and usage instructions.

SOURCE CODE
===========

NASAWASH is written in standard C.  Any ANSI (ISO) standard C compiler
should be able to compile it, in any command line environment where the
above explanation of pipelines and redirection makes sense.

NASAWASH has been tested on the following systems:
  MS-DOS with Microsoft C 6.00A
  MS-DOS with Microsoft C 8.00 (Visual C++ 1.0)
  MS-DOS with Borland C/C++ 3.1 (*)
  MS-DOS with Borland C++ 4.0
  OS/2 with Microsoft C 6.00A
  OS/2 with IBM C/Set++ 2.1
  OS/2 with Borland C++ 1.00
  UNIX (SunOS 4.1) with GCC 2.5.8 (**)
  Linux with GCC 2.7.0

(*) Borland's 3.1 implementation of perror() is slightly non-standard, so
    some of the error message formatting is a bit ugly.
(**) The standard Unix compiler (cc) is too old-fashioned to compile
     this program, since it uses function prototypes.

No executable is included with this Linux distribution.  To make the
program, type
  gcc -O -onasawash nasawash.c

A .ZIP file which includes an executable for MS-DOS is
available from ftp://ftp.amsat.org/amsat/software/PC/util/nasawash.zip.
The current version of this archive is available from
ftp://ftp.amsat.org/amsat/software/Linux/nasawash.tar.gz.


CONTACTING THE AUTHOR
=====================
As usual, this program is offered as-is, with no warrantee.
I will probably try to fix any bugs that are found, and I will
entertain requests for additional features.

If you have questions, comments, bug reports, or items for the wish
list, please contact me via email:

	kb5mu@amsat.org

Don't send me any money.  If you feel obligated to contribute, please
send your contribution to your national AMSAT organization.
