NASAWASH NASA-Format Keplerian Element Set File Cleanup Updated 31 May 2013 Copyright 1995-2013 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 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. The included executable was built with MinGW (www.mingw.org), a free open-source tool chain based on GCC. 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.