Delila Program: rb

rb program

Documentation for the rb program is below, with links to related programs in the "see also" section.

{   version = 1.05; (* of rb.p 2022 Apr 12}

(* begin module describe.rb *)
   rb: remove blanks from ends of lines in a file

   rb(input: stdin, output: out)


   input: a text file

   output: a copy of fin with trailing blanks removed from all lines,
      any blank lines at the end of the file will also be removed.
      Tabs are counted as blanks.


   Blanks can creep onto the end of lines in a file without one knowing it,
   either by the computer system, from transportation or an editor.  This
   program removes those blanks, so that less storage is needed for the
   file.  Some programs require that there be no blank lines in the file, yet
   transportation can generate blank lines at the end of the file.  This
   program will remove such lines.

   The method for doing this is interesting since it can be done in
   one pass.  Read in characters and write them out.  If a character
   is a blank, don't output it just yet, instead count the number of
   blanks.  If a non-blank character appears on the line, write out
   the previously held blanks.  But if one gets to the end of the line
   ...  forget to write out any blanks that were counted up!

   The original rembla program uses fin and fout files.  This rb version
   uses input and output to allow it to be used in Unix pipes:

   rb < myinputfile > my outputfile


   ... | rb | sort | ...

see also

   Description of what stdin means:

   file version: rembla.p

   Thomas D. Schneider

   none known

(* end module describe.rb *)
{This manual page was created by makman 1.45}

{created by htmlink 1.62}