otlhead

  1. Summary

      Keeps the specified number of outlines levels and removes the rest. Great for generating summaries, especially when using checkboxes.

  1. Usage
       Usage: otlhead level < file
              Keep the number of levels specified, remove the rest.
              Great for generating summaries.
              level   - the number of levels to include
              file    - an otl file
              input   - standard in
              output  - standard out 
  1. Examples

      If you start with the following detailed projects outline, you can use otlhead to generate summaries.

    1. Before executing otlhead
      1. My Projects
      2. [_] 33% Project 1
        1. [_] 33% Task 1
          1. [X] 100% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
        2. [_] 33% Task 2
          1. [X] 100% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
        3. [_] 66% Task 3
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [_] 0% Subtask 3
        4. [_] 0% Task 4
          1. [_] 0% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
      3. [_] 33% Project 2
        1. [_] 66% Task 1
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [_] 0% Subtask 3
        2. [_] 33% Task 2
          1. [X] 100% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
        3. [_] 33% Task 3
          1. [X] 100% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
        4. [_] 0% Task 4
          1. [_] 0% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
      4. [_] 50% Project 3
        1. [X] 100% Task 1
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [X] 100% Subtask 3
        2. [X] 100% Task 2
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [X] 100% Subtask 3
        3. [_] 0% Task 3
          1. [_] 0% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
        4. [_] 0% Task 4
          1. [_] 0% Subtask 1
          2. [_] 0% Subtask 2
          3. [_] 0% Subtask 3
      5. [_] 83% Project 4
        1. [X] 100% Task 1
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [X] 100% Subtask 3
        2. [X] 100% Task 2
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [X] 100% Subtask 3
        3. [X] 100% Task 3
          1. [X] 100% Subtask 1
          2. [X] 100% Subtask 2
          3. [X] 100% Subtask 3
        4. [_] 33% Task 4
          1. [_] 0% Subtask 1
          2. [X] 100% Subtask 2
          3. [_] 0% Subtask 3
    2. After executing: otlhead 1 < inputfile >outputfile, you get:
      1. My Projects
      2. [_] 33% Project 1
      3. [_] 33% Project 2
      4. [_] 50% Project 3
      5. [_] 83% Project 4
    3. After executing: otlhead 2 < inputfile >outputfile, you get:
      1. My Projects
      2. [_] 33% Project 1
        1. [_] 33% Task 1
        2. [_] 33% Task 2
        3. [_] 66% Task 3
        4. [_] 0% Task 4
      3. [_] 33% Project 2
        1. [_] 66% Task 1
        2. [_] 33% Task 2
        3. [_] 33% Task 3
        4. [_] 0% Task 4
      4. [_] 50% Project 3
        1. [X] 100% Task 1
        2. [X] 100% Task 2
        3. [_] 0% Task 3
        4. [_] 0% Task 4
      5. [_] 83% Project 4
        1. [X] 100% Task 1
        2. [X] 100% Task 2
        3. [X] 100% Task 3
        4. [_] 33% Task 4
  1. Script
       #!/bin/bash
       if [ "$#" -lt 1 ] ; then
       	echo " Usage: otlhead level < file"
       	echo "        Keep the number of levels specified, remove the rest."
       	echo "        Great for generating summaries."
       	echo "        level   - the number of levels to include"
       	echo "        file    - an otl file"
       	echo "        input   - standard in"
       	echo "        output  - standard out"
       	exit 0
       fi
       sed "/^\(\t\)\{$1\}.*$/ { D }" 
  1. License

      This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License.

      This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

      You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

  1. Credits
       Copyright © 2006 Noel Henson					Updated: 2006-02-19
       noel@noels-lab.com