FILT.DOC

(7 KB) Pobierz
                       FILT VERSION 1.0
                       ----------------
     Copyright (c) 1988, 1989 by Borland International, Inc.


TABLE OF CONTENTS
-----------------
1. What is FILT?
2. Summary of Options
3. Descriptions of Options


1. WHAT IS FILT?
----------------

  FILT is a text-filter program that performs some low-level formatting and 
  translation functions. As a filter, FILT does its input and output through 
  the console device (CON). Input and output files must be specified with the
  DOS redirection commands. Here's the basic syntax:

    FILT options < input_file > output_file

  The options consist of single letters and are described below. The 
  input_file and output_file, in conjunction with the redirection characters, 
  < and >, tell DOS what files to use for input and output. If no input file 
  is specified, the keyboard will be used. If no output file is specified, the 
  screen will be used.

  The options are single, case-sensitive letters. Any number of options may be 
  specified, and some of the options are followed by a number. All numbers are 
  decimal and come immediately after the option letter (with no intervening
  spaces); numbers over 65,535 will cause an error.


2. SUMMARY OF OPTIONS
---------------------

  Note: # denotes number

  Tab Replacement                 
  ---------------                 
  x  = expands tabs to spaces     
  c  = compresses spaces to tabs  

  Tab Assignment
  --------------
  e  = erases all tab stops
  t# = sets tab stop

  Character Replacement        
  ---------------------
  S  = strips high bits            
  C  = strips control chars        
  H  = strips high (>127) bytes    
  U  = all letters to uppercase    
  L  = all letters to lowercase    
  A  = capitalize words            

  Line Format
  -----------
  m  = adds left margin
  d  = deletes left margin    
  l# = truncates long lines
  r  = removes trailing spaces 
  b# = byte to end input lines 
  s  = saves carriage returns 

  End of File
  -----------
  z  = ignores ^Z in input
  Z  = suppresses ^Z in output

  I/O Buffer
  ----------
  i#  = input buffer size (20000)
  o#  = output buffer size (20000)


3. DESCRIPTIONS OF OPTIONS
--------------------------

  The following fully describes all options in alphabetical  order (lowercase 
  first):

  ?   Help.  Displays a summary of the options.

  b#  Byte to end input lines. Defines the character that will identify an end
      of line (EOL). For instance, b13 will cause a line to be ended when a 
      carriage return is reached. The default is b10. This option does not 
      effect how EOL's will be written; they are always ended with a CR+LF 
      combination.

  c   Compresses spaces to tabs. When possible, spaces will be replaced by tab
      characters (ASCII 9). The default tab stops are every eight columns, but 
      can be set manually with the e and t options.

  d#  Deletes left margin. The specified number of characters will be deleted 
      from the left side of all the lines. Any characters will be deleted.  
      Note that tabs only count as one character.

  e   Erases all tab stops. All tab stops will be erased. User-defined tab 
      stops (set with the t option) should come after the e option.

  h   Help. Displays a summary of the options.

  i#  Input buffer size. Sets the size of the input buffer. The default is 
      i20000. Making it larger might improve the processing rate for a slow 
      input device, while making it smaller will use less memory.

  l#  Truncate long lines. Lines longer than the specified length will be 
      truncated. Normally any length lines (up to about  600 characters) are 
      acceptable.

  m#  Add left margin. The specified number of spaces will be added to the 
      left margin.

  o#  Output buffer size. Set the size of the output buffer.  The default is 
      o20000. Making it larger might improve the processing rate for a slow 
      output device, while making it smaller will use less memory.

  s   Saves carriage returns. All carriage returns (ASCII 13) are normally 
      deleted from the input. This option might be useful in a file that 
      contains line boundaries without carriage returns, but does contain 
      carriage returns as some kind of special formatting code.

  r   Removes trailing spaces. Any spaces (or tabs when using the c option) 
      that come at the end of lines will be removed. Spaces at the end of 
      lines, though superfluous, are often left over from word processors.

  t#  Sets a tab stop. A tab stop will be set at the specified column number.  
      The leftmost column is column one. Any number of tab stops can be 
      specified. The default tab stops are every eight columns, i.e., t9 
      t17 t25 etc.

  x   Expands tabs to spaces. All tab characters (ASCII 9) will be replaced 
      with an equivalent number of spaces. The default tab stops are every 
      eight columns, but can be set manually with the e and t options.

  z   Ignores ^Z in the input file. A ^Z (ASCII 26) normally identifies the 
      end of a file. If this option is used, the full number of bytes recorded
      in the directory will be read.

  A   Capitalize words. Letters that follow another letter will be converted 
      to lowercase, all other letters will be converted to uppercase.

  C   Strips control characters. All characters below ASCII 32 will be 
      removed. The exceptions are the CR, LF, and Ctrl-Z characters.

  H   Strips high bytes. All characters above ASCII 127 will be removed.

  L   Converts all letters to lowercase.

  S   Strips high bits. The high bit of all bytes above ASCII 127 will be 
      cleared.

  U   Converts all letters to uppercase.

  Z   Suppresses ^Z in the output file. Normally a ^Z (ASCII 26) is written to 
      the end of the file. If this option is used, a ^Z will not be written.

  The following are some examples of FILT option and file specifications:

  filt ?
    Displays a summary of all options to the screen.

  filt cr < data.fil > data.new
    Means: c = compress spaces to tab characters; r = remove trailing spaces.  
    The input file is DATA.FIL and the output file is DATA.NEW. This 
    combination of options may greatly reduce the size of a file by compressing 
    or removing unnecessary spaces.

  filt zZCHi500o500 < a:text.xxx > c:\doc\text.txt
    Means: z = ignore any input ^Zs; Z = do not write a ^Z to the end of the 
    file; C = remove all control characters; H = remove any characters with a 
    value greater than 127; i500 = set the input buffer size to 500 bytes; 
    o500 = set the output buffer size to 500 bytes. The input file is 
    A:TEXT.XXX and the output file is C:\DOC\TEXT.TXT. This combination of
    options converts the input file into a pure ASCII file with no control 
    characters (except for the line boundaries). Note that about 39,000 fewer 
    bytes of memory are used during execution because of the buffer sizes, 
    500+500=1000 instead of the default 20000+20000=40000.
Zgłoś jeśli naruszono regulamin