Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ccb From: ccb@decvax.UUCP (Charles C. Bennett) Newsgroups: net.unix,net.decus Subject: Re: emulating ".ascii" with Awk Message-ID: <168@decvax.UUCP> Date: Thu, 23-Jan-86 19:54:05 EST Article-I.D.: decvax.168 Posted: Thu Jan 23 19:54:05 1986 Date-Received: Fri, 24-Jan-86 22:21:37 EST References: Reply-To: ccb@decvax.UUCP (Charles C. Bennett) Organization: DEC Ultrix Engineering Group - Merrimack, NH Lines: 25 Xref: watmath net.unix:6912 net.decus:248 Summary: Tricky, I don't think awk will do it. Write a little shell script. use "od -b" to break the string into bytes in octal use "sed 's/^.......[ ]*//' to strip addresses from the od output use tr to convert the spaces in the od output to newlines prepend the string "ibase=8" to the stuff you have so far feed the works to the stdin of "bc" use tr to convert the newlines to commas use sed to strip the telltale trailing comma something like: bc $TMPFILE <