#!/usr/bin/perl # # Convert text to something that Word can handle nicely. # Each paragraph should be formatted automatically, and if the first # line of the paragraph has leading whitespace, put in a tab. In # the future, we may want a tab for each whitespace character. $str = ""; while (<>) { chop; $leading = 0; if (/^ */) { s/^ *//g; $leading = 1; } if (/^o */) { s/^o */\t/g; } if (length ($_) == 0) { print "$str\r\n"; $str = ""; } else { if (length ($str) == 0 && $leading == 1) { $str = "\t"; } $str .= "$_ "; } } if (length ($str) > 0) { print "$str\r\n"; } exit (0);