home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!mcsun!Germany.EU.net!nixpbe!uranium!josef
- From: Josef Moellers <mollers.pad@sni.de>
- Subject: Re: problem with vi..
- Sender: josef@nixpbe.sni.de (Moellers)
- Message-ID: <josef.714392567@uranium>
- Date: Fri, 21 Aug 1992 10:22:47 GMT
- References: <1992Aug17.155121.21926@njitgw.njit.edu> <2195@fnnews.fnal.gov> <514@alden.UUCP>
- Organization: Siemens Nixdorf Info.Sys. AG, Paderborn, Germany
- Lines: 45
-
- In <514@alden.UUCP> sgr@alden.UUCP (Stan Ryckman) writes:
-
- >In article <2195@fnnews.fnal.gov> shah@fnalb.fnal.gov writes:
- >|>In article <1992Aug17.155121.21926@njitgw.njit.edu>, cxk6819@hertz.njit.edu (K. Chandrakanth) writes:
- >|>|> Dear netters,
- >|>|> I have a sparc workstation 2.
- >|>|> I mounted the floppy drive and copied few files from the floppy. But
- >|>|> when I viewed through vi I happened to see ^M at the end of each line.
- >|>|> When I cat the file it looks normal. Will some one tell me the reason
- >|>|> for this. If possible please send me a shell script or small c program
- >|>|> to remove this. I am enclosing a sample of the file.
- >|>|>
- >|>|> But when I compile the file it works fine. The control characters
- >|>|> are really irritating. So help me.
- >|>|>
- >|>|> struct employee {^M
- >|>|> e_type typer;^M
- >|>|> employee *next;^M
- >|>|> char name[20];^M
- >|>|> short department;^M
- >|>|> };^M
- >|>|> ^M
- >|>|> struct manager:employee {^M
- >|>|> employee* group;^M
- >|>|> short level;^M
- >|>|> };^M
- >|>|> void print_emp(employee *);^M
- >|>|> void f(employee *);^M
- >|>|> void print_emp(employee *e)^M
- >|>|> {^M
- >|>|>
- >|>|> Please email to me. Thanks in advance...
- >|>
- >|>vi the file and type following vi command:
- >|>
- >|>:%s/^VM//g
-
- [ One way to remove ^M's deleted ]
-
- I usually do ":1,$s/.$//", as the ^M's are the last character on a line.
- This works fine. Then I do "G" and get rid of the ^Z's (e.g. "Gdd").
- --
- | Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG |
- | USA: mollers.pad@sni-usa.com | Abt. STO-XS 113 | Riemekestrasse |
- | !USA: mollers.pad@sni.de | Phone: (+49) 5251 835124 | D-4790 Paderborn |
-