This might be useful to someone moving an outline from some PeeCee app or some Palm app over to Omni Outliner. Omni Outliner will import a text file formatted with "-" at the beginning of entries, tabs for level of indentation, and then tabs between fields.
In my case, I was coming from HiNote, an outliner on Palm that has a PeeCee side tool, but no Mac side tool. The PeeCee tool could export a text file with leading "-"s, one for each level of indentation. It leaves a blank line between each entry, which OmniOutliner doesn't need (but will ignore).
Sooo, to pull it into Omni Outliner, I needed to convert the leading -'s into leading tabs. For that, i wrote an 'awk' script to do the conversion:
=====
BEGIN { newline = 1; tabs = ""; }
NF == 0 { newline = 1; next; }
$1 == "-" { if (newline) { tabs = ""; } newline = 0; print tabs $0; next; }
$1 == "------" { if (newline) { tabs = "\t\t\t\t\t"; sub("------", "-"); } newline = 0; print tabs $0; next; }
$1 == "-----" { if (newline) { tabs = "\t\t\t\t"; sub("-----", "-"); } newline = 0; print tabs $0; next; }
$1 == "----" { if (newline) { tabs = "\t\t\t"; sub("----", "-"); } newline = 0; print tabs $0; next; }
$1 == "---" { if (newline) { tabs = "\t\t"; sub("---", "-"); } newline = 0; print tabs $0; next; }
$1 == "--" { if (newline) { tabs = "\t"; sub("--", "-"); } newline = 0; print tabs $0; next; }
{ newline = 0; print tabs "\t" $0; next; }
=====
With the text between "=====" lines saved as plain text file in "hn2ol.awk", I invoked this in Terminal via:
awk -f "hn2ol.awk" < hnfile.txt > oofile.txt
In my case, I actually needed to strip the carriage returns out of the file:
tr -d "\r" < hnfile.txt | awk -f "hn2ol.awk" > oofile.txt
Hope that's useful to someone someday.