                                                                     b_edit
Chapter 10 Map Manipulation

It is often necessary to clean raw data prior to importing it into the LTPlus
environment.  The b_edit command is capable of performing user-designated
preprocessing operations on a specified ascii formatted data file.

b_edit

    Pre-processes named file prior to importing.

*        b_edit ifl [ofl] [-c] [-e] [a=n] [b=n] [c=n] [d=n] [f=n] [g=n] 
                        [i=char] [j=n] [l=n] [s=n] [t=n] [xx=n]

    Activates a preprocessor against the named input file ifl to prepare it for
    importing into the LTPlus environment.  The preprocessor filtering actions
    are defined by the item=val/str argument(s) passed to this function.  The
    output from this command will be stored in the named input file (ifl)
    unless an  output file (ofl) is  designated.  The -e and -c options delete
    extension and control characters, respectively.  The item=arg parameters
    are additional filtering actions, described below.
    ___________________________________________________________________________
    Options/arguments:

         ifl       Input file, ascii format
         ofl       Name of ascii output file to which filtered results will be
                   written.  If ofl is not specified, the results will
                   overwrite the input file (ifl)

*        -c     delete all control characters other than linefeeds
*        -e     delete all extension characters
*
*        item=arg:
*                   a =   add a linefeed after specified number of characters.
*                   b =   number of lines to be deleted from the beginning of
*                         the file
*                   c =   number of characters to be deleted from beginning 
*                         of each line.
*                   d =   delete specified column from each line.
*                   f =   fill all lines to specified number of characters
*                         with blanks. 
*                   g =   combine specified number of input lines into single
*                         output lines
*                   i =   decimal equivalent of ascii character to be deleted
*                         from file (all occurrences)
*                   j =   insert a new (blank) column at specified col. number.
*                   l =   minimum length of line to be retained 
*                   s =   fill blanks with character which precedes it by 
*                         specified number of characters.
*                   t =   truncate all lines at specified number of characters
*                         if they are longer than that.  
*                  xx =   Replace ASCII (decimal) value xx with ASCII (decial) 
*                         value n.  e.g, to replace all semi-colons (ascii 
*                         decimal value 59) with linefeeds (ascii decimal value
*                         10) use a specification:     59=10
*
*    NOTE: only one of each parameter may be specified for all parameters 
*  except:  d,i,j,xx 
*    NOTE: ANY combination of parameters is legal.
*    NOTE: line length does NOT include the linefeed character.
*    NOTE: columns are numbered with the beginning column being number 1.
*    NOTE: The order in which these parameter take effect can be important.  
*  Here is the process in which the file is read, edited, and written:
*  1.  One line is read from the input file.  Control (-c) & extention (-e) 
*      characters are deleted if specified.  If a linefeed is not encountered 
*      first and there is a specified value (a=), a linefeed is inserted at the *      specified number of characters (not counting the characters deleted by 
*      -c & -e).  b_edit will not do line length processing of lines longer
*      than 2000 characters, although other processing may be done.
*  2.  If there is a specified number of lines to delete from the top of the 
*      file (b=), then the line number of the read line is checked & the line
*      is omitted from output if it is within the specified count.  If so,
*      return to step 1 & read next line.
*  3.  If a minimum line length is specified (l=), then the length of the line
*      is checked.  If it is less than the specified length, then it is 
*      disreguarded.  If so, Return to step 1 & read next line.
*  4.  If there is a specification to delete a number of characters from the
*      beginning of each line (c=), then that number of characters is deleted
*      from the line.  If there are fewer characters than specified under 
*      c=, then all characters of the line are deleted, but processing 
*      continues.
*  5.  The line is scanned for occurrances of specified ascii characters to be
*      deleted (i=), if specified.  They are deleted if present.
*  6.  If column delete(s) are specified (d=) then those columns are deleted   
*      (if they exist) beginning with the column furthest to the RIGHT.
*  7.  If column insertion(s) are spedified (j=) then those columns are added
*      beginning with the column furthest to the RIGHT.  If the string does
*      not have enough columns, then it is filled with blanks up to the maximum
*      column specified under j= , THEN expanded beginning from the RIGHT.
*  8.  If fill to a given length is specified (f=) then the line is filled
*      to that length if it is shorter than specified.  If longer, then it 
*      is left alone.
*  9.  If blanks are to be replaced by a preceding character (s=) then they 
*      are replaced by the specified preceding character.  If the specified 
*      preceding character is on the previous line, then it is used only if the 
*      previous line is to be joined (g=) with this line.  Otherwise, or If 
*      there is no preceding line or if there are insufficient characters on 
*      the preceding line to go back s characters, then the blank(s) are left.
* 10.  If line truncation is specified (t=) then the line is truncated at that
*      length if it is longer.  Shorter lines are left alone.
* 11.  The grouping (g) parameter is checked and a linefeed character is added
*      to the end of the line if no grouping is specified, or if the specified 
*      number of lines has been written according to the grouping parameter.
* 12.  All character replacement (xx=) is done.  Any number of characters
*      (control, displayable, or extention) may be replaced for any other
*      ASCII character in the range of 0 to 255.
* 13.  The line is written to the output file.
* 14.  Go to step 1.
*
___________________________________________________________________________
    Example(s):

    To remove all extension and control characters, 34 lines from the beginning
    of the file, 4 characters from the beginning of each line and all
    occurrences of the character G from the ascii file cub_mtn and store the
    results in an ascii file called cub_peak, enter:

         b_edit cub_mtn cub_peak -c -e b=34 c=4 i=71

    To remove all control characters and retain only lines with a minimum line
    length of 40 from a file called cub_creek and store the results in that
    same file, enter:
     
         b_edit cub_creek -c l=40

    To replace all occurrances of the semi-colon (ASCII 59) with linefeeds 
    (ASCII 10) enter:

         b_edit cub_creek 59=10
    ___________________________________________________________________________
