On Mon, Sep 17, 2001 at 05:29:04PM +0800, Chang wrote:
> 1. Does vi have a hex viewer mode? Or should I use soemthing else?
> Something like the PCTOOLS or LIST in DOS would be nice.
> 
> 2. How could I translate 0x0A into 0x0D+0x0A with tr? I tried
> tr '\012' \015\012' < file.unix > file.dos
> but only \015 was there. I was using the dos version of tr

I do no think you can translate one character into two. I think you have to
use sed. The newer sed versions allow any hex (or octal or decimal)
character to be processed:
cat file | sed 's/\o012/\o015\o012/g' might work. Haven't tried it though.
Obviously, this sort of substitution makes sed very handy.
Joel


_______________________________________________
http://linux.nf -- [EMAIL PROTECTED]
Archives, Subscribe, Unsubscribe, Digest, Etc 
->http://linux.nf/mailman/listinfo/linux-users

Reply via email to