Trim File

  • Rating:
  • Version: 3
  • Publisher:
    www.psc-consulting.ca
  • File Size: 194.96 KB
  • Date: Jul 18, 2010
  • License: Freeware
  • Category:
    Text Editor
    File & Disk
Trim File Download
Free Download Trim File 3

Remove trailing spaces and tabs from plain text files. TrimFile is a Java console application to remove trailing white space (blanks or tabs) from the end of each line in a plain text file. Extra spaces commonly accumulate while editing source programs in a graphical compiler (IDE). They arent a problem, but they do waste file space and occasionally affect the appearance of programs. Please read the PDF documentation included in the ZIP file. This program has been released under the GNU General Public License.

Input and output files are read and written as sequences of characters. You may specify the character set encoding. The local system's default encoding will be assumed if you don't choose an encoding. The input file name is usually the first parameter (argument) on the command line. An output file name is usually the second parameter. If no output file is given, then output will be written on standard output (the console), which may be redirected with the ">" operator. If no input file is given, and no option to read from standard input, then an error message is printed. A typical command line would be:

java TrimFile3 -local filename.txt newfilename.txt

Options may be given on the command line. They should appear before the file names, but this is not strictly enforced. Most options are related to the characters (bytes) used to separate lines in the text file. Linux/UNIX and most newer systems want a single "newline" character (NL or 0x0A); older Macintosh OS 9 applications used a single "carriage return" (CR or 0x0D); many DOS and Windows applications still use CR immediately followed by "line feed" (LF, which is also 0x0A). All of these separators are recognized on input; you may select the output separator. The options are:

-clean
do not copy unrecognized control codes to the output file. Extra control codes are normally passed through as text characters (unchanged).

-code=name
specifies both -incode and -outcode. The default is the local encoding. You may need to quote this according to your system's command syntax.

-copy
copy the input text without trimming. Use this option to change character sets or line separators without removing trailing white space.

-cr (or) -mac
separate output lines with CR characters for Macintosh OS 9 (0x0D).

-crlf (or) -dos
separate output lines with CR/LF pairs for DOS/Windows (0x0D/0x0A).

-help (or) -?
show a summary of the command-line options and syntax.

-incode=name
specifies the input character set. This option is only necessary when the input and output have different character sets, and does not apply when reading from standard input. See the -code option first.

-input=name
specifies the input file name, when the name looks like an option and can't be given as a parameter on the command line. You may need to quote this according to your system's command syntax.

-local (or) -default
use the local system's default line separator on output.

-nl (or) -lf (or) -unix
separate output lines with UNIX newline characters (0x0A).

-outcode=name
specifies the output character set. This option is only necessary when the input and output have different character sets, and does not apply when writing to standard output. See the -code option first. No error is generated if an output encoding can not represent input characters; a replacement character will be arbitrarily chosen.

-output=name
specifies the output file name, when the name looks like an option and can't be given as a parameter on the command line. You may need to quote this according to your system's command syntax.

-same (or) -asis
use the same line separators on output as from the input (default).

-stdin
read input from standard input (pipe) instead of a file. You must specify this option if you aren't using a file.

-stdout
write output on standard output (pipe) instead of a file. This is the default action if an output file name is not given.

You may use the null device for output if you only want to check that a text file has no trailing space (see /dev/null on Linux/UNIX or NUL: on DOS/Windows). The console application will return an exit status equal to the number of white space characters removed (zero or more), or -1 for errors. There is no graphical interface (GUI) for this program; it must be run from a command prompt, command shell, or terminal window.

Requirements:
* Java

The license of this software is Freeware, you can free download and free use this text editor software.

More Details:
Related Software: