home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5207 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.7 KB  |  45 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!mcsun!news.funet.fi!ajk.tele.fi!funic!convex!vsarkela
  3. From: vsarkela@convex.csc.FI (Vesa S{rkel{)
  4. Subject: Re: stripping cr/lf's
  5. Message-ID: <1992Dec31.173940.3324@nic.funet.fi>
  6. Sender: usenet@nic.funet.fi
  7. Nntp-Posting-Host: convex.csc.fi
  8. Organization: Finnish Academic and Research Network Project - FUNET
  9. References: <1992Dec31.071312.6153@netcom.com> <1992Dec31.165409.23109@mnemosyne.cs.du.edu>
  10. Date: Thu, 31 Dec 92 17:39:40 GMT
  11. Lines: 32
  12.  
  13. In <1992Dec31.165409.23109@mnemosyne.cs.du.edu> jefouger@nyx.cs.du.edu (Jim  Fougeron) writes:
  14.  
  15. >kasajian@netcom.com (Kenneth Kasajian) writes:
  16.  
  17.  
  18. >>How do I strip the cr's from a text file?  There must be a standard
  19. >>unix way of doing it!
  20. >>thanks
  21.  
  22. >I perform this task with a utility from Omen (rz/sz people) called undos.
  23. >This program will convert files from dos-unix-mac-cpm.
  24. >If you wanted to do this ONLY using standard Unix commands, one way is:
  25. >tr -d '/15' < infile > outfile
  26.  
  27. this should be tr -d '\15' <infile >outfile 
  28. or tr -d 13 <infile >outfile
  29. (carriage retun = 13 decimal = 15 octal = 0D hexadecimal)
  30.  
  31. >NOTE: Do not do this on anything other than PLAIN text, or you will end up
  32. >      with  a corrupted output file.
  33. >Hope this helps.
  34.  
  35. you are welcome
  36.  
  37. >--
  38. >---------------------------------------------------------------------------
  39. >|  Jim Fougeron                |  What is the true meaning of happiness?  |
  40. >|  jefouger@nyx.cs.du.edu      |   Is it money, cars and women, ... or    |
  41. >|  jimfn@ids.net               |   just money and cars?  Calvin & Hobbes  |
  42.  
  43. Vesa Sarkela                       Keskuslaboratorio Oy
  44. vsarkela@convex.csc.fi   Finnish Pulp & Paper Research Institute
  45.