View Single Post
I just went through this and took a different method -- importing the tiered number list into Pages (similar to what's described above) didn't work, and I don't have Word. I did have several thousand lines of an outline that I wanted in OmniOutliner... not going to happen manually. So, I C&P'd the list into TextWrangler and used the regex find and replace function. It wasn't too tough.

The list I started with was something like:

1.0 stuff
1.1 stuff about stuff
1.1.1 stuff about stuff about stuff
1.2 different stuff about stuff
1.2.1 stuff about different stuff about stuff
2.0 different stuff
2.1 ...

The regex I started with was:

Find:
Code:
^\d+\.[^0]
Replace:
Code:
\t&
For those less familiar with regex,
  • "^" means "the beginning of the line"
  • "\d" means any number
  • "+" means "one or more of the thing before this" (in this case any number, therefore catching double / triple digit numbers etc)
  • "\." means a period
  • "[^0]" means "anything except a 0"
  • "\t" means a tab
  • "&" means "everything matched in the pattern above"

Basically, this finds every line where it starts with a number, then a period, then anything but a zero, and indents it with a tab. This leaves all the bottom-level parts of the outline unindented. In the example above, it would not match 1.0 but it would hit on 1.1 , 1.1.1 , etc.

Then, I followed that with a second:

Find:
Code:
^\t\d+\.\d+\.
Replace (same as above):
Code:
\t&
Following the patterns from above, this will look for lines starting with a tab, followed by a number, followed by a period, followed by another number, followed by another period.. and indent them by one tab. This would match [tab]1.1. but not 1.0 (base level) or [tab]1.1 (first indented level).

From there, I just added an extra "\t" to the front and "\d+\." to the end of the Find pattern...
Find:
Code:
^\t\t\d+\.\d+\.\d+\.
Replace:
Code:
\t&
and kept going until there were no more matches. Each additional "\t" on the front and "\d+\." on the end of the Find pattern matches one extra level of indentation, indenting the subpoints one level farther.

Once I was done, I just copied and pasted into OmniOutliner and the tabs produced an outline with foldable levels, just as described above. Just FYI, I grabbed the outline from a PDF with botched OCR, scrapping the bad OCR data and starting from scratch using the technique I outline here. I'm guessing that .pdf outlines may be a common reason that people would be trying to fix outline formatting for importing into OmniOutliner, since they tend to ruin formatting in my experience.