DECOMMENT
Remove "#" comment lines


DECOMMENT is a C++ program that makes a copy of a file in which all lines beginning with the "#" character have been removed.

It is a comment convention to indicate comments in a file by an initial "#" character. I often use this convention in my data files, and it is part of the TABLE format. However, certain hard-hearted or soft-headed programs will not accept comment lines. The DECOMMENT program allows me to comment my data files, but then to easily make an uncommented version, when necessary, to feed to illiterate programs.

Related Data and Programs:

CR2LF reads a text file and replaces carriage returns by line feeds.

CRRM makes a copy of a text file which contains no carriage returns.

DEBLANK makes a copy of a text file which contains no blank lines.

FILUM is a library of C++ routines for performing various operations on files.

REFORMAT reads a text file that contains only real values, and writes a copy which has a fixed number of real values on each line.

REWORD reads a text file and writes a copy which has a fixed number of "words" per line.

UNCONTROL makes a copy of a text file which contains no control characters.

WRAP makes a copy of a text file in which no line is longer than a user-specified wrap length.

WRAP2 is a C++ program which wraps long lines in a text file, but which wraps some lines "early", so as to avoid breaking words.

Usage:

decomment old.txt new.txt
reads the file old.txt and creates a copy new.txt containing no carriage returns.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.


Last revised on 02 December 2006.