Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!ames!amdahl!pyramid!athertn!joshua From: joshua@athertn.Atherton.COM (Flame Bait) Newsgroups: alt.sources Subject: ms2me.awk, translates troff file, ms to me Message-ID: <11735@joshua.athertn.Atherton.COM> Date: 18 Aug 89 01:26:48 GMT Reply-To: joshua@joshua.Atherton.COM (Flame Bait) Organization: Atherton Technology, Sunnyvale, CA Lines: 33 # # MS2ME.AWK (version 1.0) # By Joshua Levy joshua@atherton.com home:(415)968-3718 # {decwrl|sun|hpda}!athertn!joshua work:(408)734-9822 # # Converts ms documents to me documents. # Sleeze hack solution, quick to write, but only does 80% of the job. # # usage: awk -f ms2me.awk output.me # # You must go over the output of this program, and translate some of the # macros by hand. Most of these macros are on the first page (ie. TL, # AE, AB, etc). If you make any improvements to this program please send # them back to me. Thanks. # $1==".PP" { $1 = ".pp" ; } $1==".IP" { $1 = ".ip" ; } $1==".LP" { $1 = ".lp" ; } $1==".KS" { $1 = ".(b" ; } $1==".KE" { $1 = ".)b" ; } $1==".FS" { $1 = ".(f" ; } $1==".FE" { $1 = ".)f" ; } $1==".RS" { $1 = ".in +5" ; } $1==".RE" { $1 = ".in -5" ; } $1==".DS" { $1 = ".(d" ; } $1==".DE" { $1 = ".)d" ; } $1==".XP" { $1 = ".xp" ; } $1==".AI" { $1 = ".sp 1" } $1==".NH" { level = $2 ; getline title ; printf ".sh %d \"%s\"\n", level, $0 ; next ; } $1==".TL" { print ".sz +2" ; $1 = ".ft B" ; } $1==".AU" { print ".ft R" ; $1 = ".sz -2" ; } { print $0 ; }