Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclkms!ken From: ken@hpclkms.HP.COM (Ken Sumrall) Newsgroups: comp.sys.atari.8bit Subject: Re: ATASCII to ASCII Message-ID: <1270024@hpclkms.HP.COM> Date: 12 Nov 89 03:19:39 GMT References: <18039@watdragon.waterloo.edu> Organization: Hewlett-Packard Calif. Language Lab Lines: 32 >I have a couple of text files that I would like to print from my Unix account, >but they are ATASCII files, not ASCII. Is there a utility I can use to convert >them to ASCII without having to download them to... Why not just use tr(1). When I missed a few issues of zmag a while back, I called a BBS, and pulled down an ARC of the missing issues. Then the fun began, as I had to hunt down an ARC program (I have ARC5.21 sources if anybody wants them. I added #ifdef's to handle HP-UX on the series 300, 500, and 800), and after I de-arc'ed them, I too had to convert them from atascii to ascii. I made a very simple shell script using tr(1) to convert the file for me. Here is is: --------------------------------------------------------------------------- #!/bin/sh #This reads in ATASCII files, and spits out unix text files. #Stdin and stdout are used. tr -d "[\001-\037][\200-\232][\234-\377]" |tr "\233" "\012" --------------------------------------------------------------------------- Basically, what it does is remove all characters in the range 1-31, 128-154, and 156-255. (I wanted it to remove character 0 also, but tr(1) chokes when you try to muck with the null character). Then tr(1) converts character 155 (Atari EOL) to character 10 (unix EOL). This worked fine in converting the zmag's. Hope this helps. Ken Sumrall HP California Language Labs ken%hpda@hplabs.hp.com ...!hplabs!hpda!ken