Quantcast
Viewing all articles
Browse latest Browse all 5103

Off topic discussion • Re: Getting the text out of "Textra" word processor docs circa 1985

Here's better code for B (simple printing version). Better handling of the headers. A few tabs in lieu of true centering.

Code:

#!/usr/bin/awk -f# program to strip formatting from a LotusWorks document#   and replace it with simple formatting for printing#   also replicate the headings at the top of each new page# print the output of this program as follows:#   lworks_print.awk myfile.doc | tee myfile.doc.prn | lp -o media=Custom.11x8.5in#   cat myfile.doc.prn | lp -o media=Custom.11x8.5inNR < 9 {next}# big block of unknown stuff up top/\x0d/{gsub(/\x0d/,"")}# dos line ending/^@ /{gsub(/@ /,"")final_heading = 1}# final line of page headers? /^\|/{gsub(/\|/,"")headings = headings "\t\t\t" $0 "\n"next }# centering? only in page headers? final_heading==1{ print headingsfinal_heading = 0 }/\xae\x29\x40\xaf/{gsub(/\xae\x29\x40\xaf/,"\f\n" headings)} # page break : form feed/^\x10/{gsub(/\x10/,"")}# paragraph of text to be wrapped? /\x1a/{next}# end of document indicator ? {print $0}

Statistics: Posted by tinker2much — Thu Jan 11, 2024 2:03 am



Viewing all articles
Browse latest Browse all 5103

Trending Articles