home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10255 < prev    next >
Encoding:
Text File  |  1992-08-20  |  2.1 KB  |  57 lines

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