[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Vim/formatting question (WordPerfect files)
From: |
Nick Stoughton |
Subject: |
Re: [Groff] Vim/formatting question (WordPerfect files) |
Date: |
Tue, 13 Mar 2007 15:04:21 -0700 |
Try using tr ... The character '^@' is a null byte (for tr, this is
'\000'). You can strip out all control chars by:
tr -d '[:cntrl:]' < xxx.wpd > xxx.txt
(or, in vim: gg!Gtr -d '[:cntrl:]')
This won't strip out chars with the top bit set, but read the man page!
On Tue, 2007-03-13 at 15:15 -0600, Clarke Echols wrote:
> This is only partly on/off topic, but I need help with a messy
> little problem.
>
> I have been asked to evaluate a book project with the possibility
> that I will be producing it for publication. The author sent me
> a WordPerfect file (.wpd suffix) that my Microsoft stuff won't read.
> Like Word, it's a binary file that has the text embedded in it.
>
> Words are separated by a single character that displays in vim as
> a (blue) couple of characters: ( ~@ ) and there are other characters
> showing up as ( ^U, ^^, ^@, ) etc. I know how to do regular
> expression search and replace for control characters like ^U, but
> this ~@ stuff is something I don't know how to specify in a search
> string.
>
> Any clues? Or an easy way to convert this to plain text without
> buying a bunch of software?
>
> I'm a vim/groff bigot and don't like canned "authoring" software--
> especially if I have to pay for it. :-)
>
> Thanks,
>
> Clarke
>
>