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