home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5231 < prev    next >
Encoding:
Text File  |  1993-01-03  |  950 b   |  33 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!wupost!usc!sdd.hp.com!network.ucsd.edu!pacbell.com!UB.com!quack!dfox
  3. From: dfox@quack.sac.ca.us (David Fox)
  4. Subject: Re: stripping cr/lf's
  5. Message-ID: <fXuiJ5p@quack.sac.ca.us>
  6. Organization: The Duck Pond public unix: +1 408 249 9630, log in as 'guest'.
  7. References: <1992Dec31.071312.6153@netcom.com>
  8. Date: 3 Jan 1993 23:00:32 UTC
  9. Lines: 22
  10.  
  11. In article <1992Dec31.071312.6153@netcom.com> kasajian@netcom.com (Kenneth Kasajian) writes:
  12. >
  13. >How do I strip the cr's from a text file?  There must be a standard
  14. >unix way of doing it!
  15.  
  16. There is.  One typically needs to do this when migrating DOS text files (where
  17. each line ends in a CR and NL (ascii 13/10) to Unix (where each line ends with
  18. just NL (ascii 10)).
  19.  
  20. Use the tr command.
  21.  
  22. % tr -d '\015' <in.txt >out.txt
  23.  
  24. The '\015' may look strange: tr - and other unix commands - think in OCTAL.
  25. Octal 015 = 12 decimal.
  26. --
  27. David Fox
  28. dfox@quack.sac.ca.us
  29.  
  30.  
  31.  
  32.  
  33.