home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / misc / 5011 < prev    next >
Encoding:
Text File  |  1993-01-26  |  1.4 KB  |  49 lines

  1. Newsgroups: comp.unix.misc
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!caen!batcomputer!munnari.oz.au!metro!usage!news
  3. From: cameron@cs.unsw.oz.au
  4. Subject: Re: post script to text
  5. Message-ID: <cameron-930126162817-1-12394@fuligin>
  6. To: sljn6@cc.usu.edu
  7. Sender: news@usage.csd.unsw.OZ.AU
  8. Nntp-Posting-Host: fuligin.spectrum.cs.unsw.oz.au
  9. Reply-To: cameron@cs.unsw.oz.au
  10. Organization: CS&E Computing Facility, Uni Of NSW, Oz
  11. References: <1993Jan24.171940.63123@cc.usu.edu>
  12. Errors-To: cameron@cs.unsw.oz.au
  13. Date: Tue, 26 Jan 1993 05:28:43 GMT
  14. Return-Receipt-To: cameron@cs.unsw.oz.au
  15. Lines: 32
  16.  
  17. | I wanted to know if there is any freely available
  18. | software to change post script file to txtt
  19.  
  20. I append a quick hack I have used with some success. It produces rudamentry
  21. text output amenable to further formatting.
  22.     - Cameron Simpson
  23.       cameron@cse.unsw.edu.au, DoD#743
  24. --
  25. Theorectial Physicist,N.:A physicist whose existence is postulated, to make
  26. the numbers balance but who is never actually observed in the laboratory.
  27.  
  28. #!/bin/sh
  29. #
  30. # Cut here and feed through /bin/sh to extract unps.
  31. #
  32.  
  33. sed 's/^X//' > unps <<'EOF-//fuligin/1/cameron/bin/unps'
  34. X#!/bin/sh
  35. X#
  36. X# Like strings(1) for PostScript.
  37. X#    - Cameron Simpson, 21nov92
  38. X#
  39. X
  40. Xsed -e '/([^()]*)/!d
  41. X    s/[^()]*(//
  42. X    s/)[^()]*(/\
  43. X/g
  44. X    s/)[^()]*$//
  45. X    /^$/d' ${1+"$@"} | fmt
  46. EOF-//fuligin/1/cameron/bin/unps
  47.  
  48. exit 0
  49.