Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > SWITCHER TIPS: HiNote 2 Omni Outliner

SWITCHER TIPS: HiNote 2 Omni Outliner
Thread Tools
Mac Elite
Join Date: Jul 2000
Location: Dallas, TX, USA
Status: Offline
Reply With Quote
Sep 29, 2003, 03:19 PM
 
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.
Mac Nut since before color Macs, working for UT Austin Microcenter supporting Mac users
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:53 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2