I've imported a lot of files from a DOS word processor. These have lots of control sequences of the form M-J ) New lines I think). I can search for the M, which is Return, but I don't see any way to get the -J. Is it possible?

IIUC, you have CR/LF pairs in the incoming file and want do do something to them?

Vim does some sniffing to detect the fileformat (":he 'ff'")...if they're all CR/LF pairs, the FF will come up as DOS. However, if there are some mismatched pairs in there, it often comes up as Unix format. It sounds like you're getting the latter format...that you're seeing Vim display the ^M (CR) and the ^J (LF) is interpreted as a line-break.

Thus, what you're looking for is

        :%s/\r\n/replacement


However, you may want to keep the original line breaks, in which case, you just want to use

        :%s/\r$/replacement

With a bit more information about what you're trying to do and what's in the file (are they paragraphs separated by double blank lines that you want to preserve? do the original line-breaks have significance to you?) you might have to modify this idea.

HTH,

-tim






Reply via email to