Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!shelby!neon!lucid.com!campeau!jwz From: jwz@lucid.com (Jamie Zawinski) Newsgroups: comp.lang.postscript Subject: Re: Translating PostScript to ASCII: A Proposal Message-ID: Date: 25 Feb 91 06:15:16 GMT References: <23304@well.sf.ca.us> Sender: usenet@lucid.com Distribution: comp Organization: Lucid, Inc., Menlo Park, CA Lines: 15 In-Reply-To: shiva@well.sf.ca.us's message of 23 Feb 91 09:05:57 GMT Ok, I've been meaning to write this for a while... Sort of the canonical 'sed' program. Put this in your .cshrc file: alias unps \(sed \ \''s/^[ \t]*[^()]*$//g;s/%.*$//g;s/^[^(]*(//g;s/)[^(]*(/ /g;s/)[^)]*$//g;'\' \ \| tr '\\012' '\\040' \| tr -s '\\040' '\\040' \; echo \'\'\) and then "unps < somefile" will extract all of the PostScript strings from "somefile." There will be no newlines, and all occurences of multiple spaces will be collapsed to a single space, so you'll need to wrap the lines by your favorite method. -- Jamie