home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / tools / createtb.doc < prev    next >
Encoding:
Text File  |  1988-05-03  |  4.3 KB  |  98 lines

  1.      CREATE_TB scans text files and creates a table by selecting specified line
  2. entries.  The text files are assumed to contain standardized entries which are
  3. repeated in each file.  CREATE_TB extracts a subset of these entries compressing
  4. their text into a specified column width for printing in a tabular form.  The
  5. entries to be extracted and the width of each column may be specified by the
  6. user for each table.  CREATE_TB will scan a group of files identified by a UNIX 
  7. file pattern(including *, ?, or selectors [aeiou]) and it also recognizes PAGE
  8. headers of the form:
  9.  
  10.                     ::::::::::                   --::::::::::
  11.                     FILENAME         or          --FILENAME
  12.                     ::::::::::                   --::::::::::
  13.  
  14. as file separators.
  15.  
  16.      Within each file (or subfile), CREATE_TB selects lines whose first three
  17. characters match a selection field specified by the user.  Once a line has been
  18. selected as the result of a match, subsequent lines with blanks in the first
  19. three columns are treated as continuations of the selected line.  The first line
  20. of an entry is assumed to contain an entry title followed by a ':'.  The entry
  21. title is used as a column header and does not appear as part of the text.
  22. Thus, the assumed format of an entry is:
  23.  
  24.                     001  ENTRY TITLE :  entry text.................
  25.                        any number of continuation lines
  26.                        just so they start after column three
  27.  
  28. Other than the three character ID field, the three line subfile header,  and the
  29. entry title being delimited by a colon, no other assumptions are made on the 
  30. source text file.
  31.  
  32.  
  33. OPERATION
  34.  
  35.      When CREATE_TB is run the user is prompted for three inputs.  For example:
  36.  
  37.         ENTER TABLE_FILE_NAME=>my_table
  38.         ENTER FIELD SELECTOR=>004:10  001:20  006:30
  39.         ENTER NAMES OF FILES TO BE SCANNED=>tool_chest
  40.         
  41. The TABLE_FILE_NAME is the name of the file in which the table will be created.
  42. The field selector is a list of ordered pairs, each consisting of a three
  43. character id followed by the column width.  A ':' is used to separate each fieldof the ordered pair.  Ordered pairs may be separated by blanks, commas,
  44. semicolons, or colons.  Note that the total table width is the sum of the column
  45. widths plus 3times the number of columns.  This width is printed on the screen
  46. at the start of table processing.  Also each file or subfile name is printed as
  47. it is read.  The last input is a single file name or a pattern indicating the
  48. set of files to be processed.
  49.  
  50.  
  51. SIMPLE EXAMPLE
  52.  
  53.      Assume a file similar to:
  54.  
  55. ::::::::::
  56. TE.text
  57. ::::::::::
  58. 001 STATE : Texas
  59. 002 GOVERNOR : E. J. Junior
  60. 003 DESCRIPTION : The home of the Dallas Cowboys (aka America's Team)
  61.           past World Champions.
  62. ::::::::::
  63. MD.text
  64. ::::::::::
  65. 001 STATE : Maryland
  66. 002 GOVERNOR : Neil Lomax
  67. 003 DESCRIPTION : The home of the Washington Redskins (aka District of Columbia)
  68.           past World Champions.
  69. ::::::::::
  70. MO.text
  71. ::::::::::
  72. 001 STATE : Missouri
  73. 002 GOVERNOR : Roy Green
  74. 003 DESCRIPTION : The home of the St. Louis Cardinals (aka Up and Coming)
  75.           have never been World Champions.
  76.  
  77.  
  78.         a field selector of:   002:15  001:10  003:30
  79. would produce a table similar too:
  80.  
  81.  
  82. ===============================================================
  83.   GOVERNOR      |  STATE     |   DESCRIPTION                  |
  84. ===============================================================
  85. E. J. Junior    | Texas      | The home of the Dallas         |
  86.                 |            | Cowboys (aka America's Team)   |
  87.                 |            | past World Champions           |
  88. ===============================================================
  89. Neil Lomax      | Maryland   | The home of the Washington     |
  90.                 |            | Redskins (aka District of      |
  91.                 |            | Columbia) past World Champions.|
  92. ===============================================================
  93. Roy Green       | Missouri   | The home of the St. Louis      |
  94.                 |            | Cardinals (aka Up and Coming)  |
  95.                 |            | have never been World          |
  96.                 |            | Champions.                     |
  97. ===============================================================
  98.