Index O'Stuff

Home

Compression

Arithmetic Coding
Burrows-Wheeler Transform
Huffman Coding
LZSS Coding
LZW Coding
Run Length Encoding

Misc. Programming

School Projects
Thesis Project
crypt(3) Source
Hamming Codes
Bit Manipulation Libraries
Square Root Approximation Library
Sort Library
Trailing Space Trimmer and Tab Remover
Command Line Option Parser

Humor

Dictionary O'Modern Terms
The Ten Commandments of C Style

Other Stuff

TOPS Success Story
Free Win32 Software

External Links

SPAN (Spay/Neuter Animal Network)
Los Angeles Pet Memorial Park

Mirrors
Pages at geocities
Pages at dipperstein.com

Obligatory Links
NoteTab Credits
Quanta Credits
Linux User Number

Visits since I started counting:
Counter

Trailing Space Trimmer and Tab Remover


About The Software

The trailing space trimmer and tab remover started as a 30 minute at home hack to save me time and sanity at work. I inherited some code that was filled with intermingled tabs and spaces. Many of the lines had random amounts of trailing space too. Things might have been reasonable if it weren't for the fact that the author's tabs stops were different than mine. Indentation seemed random and was more of a distraction than a benefit.

I decided that I needed a beautifier to make the code indentation something useful. After a few minutes of searching, I was unable to find a simple and free beautifier. I figured that it would take less than 30 minutes to write a hack to convert the tabs to spaces and that would be enough to preserve my sanity. It actually took 37 minutes.

A few more minutes were required to strip off the trailing spaces, and then a little more time to add command line options, comments, and the GPL stuff. This web page has taken more time than that code.

Using The Software

Trim compiles to a console program that is executed as follows:

Usage: trim <options>

Options:
    -t : tab size.
    -i <filename> : Name of input file.
    -o <filename> : Name of output file.
    -h | ? : Print out command line options.

Default: trim -t4 -i stdin -o stdout

That's all there is.

Actual Software

I am releasing my trailing space trimmer and tab remover under the GPL. At this time I only have one revision of the code to offer. As I add enhancements or fix bugs, I will post them here as newer versions. The larger the version number, the newer the version. I'm retaining the older versions for historical reasons. I recommend that most people download the newest version unless there is a compelling reason to do otherwise.

Each version is contained in its own zipped archive which includes the source files and brief instructions for building an executable. None of the archives contain executable programs. A copy of the archives may be obtained by clicking on the links below.

Version Comment
Version 0.2 Replaces getopt with my optlist library.
Version 0.1 Initial release.

If you have any further questions or comments, you may contact me by e-mail. My e-mail address is: mdipper@alumni.engr.ucsb.edu

Home
Last updated on January 4, 2006

1