Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!kitty!bakerst!kathy From: kathy@bakerst.UUCP Newsgroups: comp.unix.questions Subject: Re: Invisible Ascii with VI Message-ID: <931@bakerst.UUCP> Date: Sun, 27-Sep-87 05:25:53 EDT Article-I.D.: bakerst.931 Posted: Sun Sep 27 05:25:53 1987 Date-Received: Sun, 27-Sep-87 21:37:39 EDT References: <258@unx1.UUCP> Reply-To: kathy@bakerst.UUCP (Kathy Vincent) Organization: Chocoholics Anonymous UnLtd, Winston-Salem, NC Lines: 39 In article <258@unx1.UUCP> andy@unx1.UUCP (Andy Clews) writes: >Does anyone out there know if it's possible to insert/search/replace >non-printing ascii characters? I don't have a global answer to this question, but I know you can do some things for sure - just remember to precede the character with a backslash so that it's taken literally. For example, lots of times, I'll want to remove overstrike characters and backspaces from nroff output: g/.\^H/s///g This will *look* like g/.^H/s///g when you've finished typing it in, but you actually enter a backslash and a backspace. I'm pretty sure I've done that with ESC characters, too - to remove the half-linefeed codes. Wouldn't swear by that, tho. >Specifically: I sometimes get files from a net source that have an "extra" >CR tacked on the end of the line, and VI shows them as ^M on the screen. >For various reasons these are a pain. I'd like to be able to get rid of >them with, say, a global substitute. I've tried 1,$s/^V^M$// but this >does not seem to do what I want. THIS, tho, I do all the time. Don't bother to try to match the ^M. Just match a single character at the end of every line - because, after all, there *is* one at the end of every line: 1,$s/.$// Kathy Vincent ------> Home: {ihnp4|mtune|codas|ptsfa}!bakerst!kathy ------> AT&T: {ihnp4|mtune|burl}!wrcola!kathy