Keeps the specified number of outlines levels and removes the rest. Great for generating summaries, especially when using checkboxes.
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
If you start with the following detailed projects outline, you can use otlhead to generate summaries.
#!/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 }"
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.
Copyright © 2006 Noel Henson Updated: 2006-02-19 noel@noels-lab.com