Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 2003 20:45:43 -0400
From:      parv <parv_fm@emailgroups.net>
To:        Paul Beard <paulbeard@mac.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to remove ^M character
Message-ID:  <20030802004543.GB22483@moo.holy.cow>
In-Reply-To: <8163366.1059777948620.JavaMail.paulbeard@mac.com>
References:  <8163366.1059777948620.JavaMail.paulbeard@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <8163366.1059777948620.JavaMail.paulbeard@mac.com>,
wrote Paul Beard thusly...
>
> got room for one more? 
> 
> perl -pi -e s#\\r#\\n#g <your file name>

Doesn't work...

  file p
  p: ASCII text

  unixdos p q
  UnixDos 1.0.13 - SUMMARY: A total of 3 end of line characters were modified.

  file p q
  p: ASCII text
  q: ASCII text, with CRLF line terminators

  perl -pi -e 's#\\r#\\n#g' q  # quotes are mine

  file p q
  p: ASCII text
  q: ASCII text, with CRLF line terminators


This works...

  perl -pi -e 's/\r$//g' q

  file p q
  p: ASCII text
  q: ASCII text


  - Parv

-- 
A programmer, budding Unix system administrator, and amateur photographer
seeks employment:  http://www103.pair.com/parv/work/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030802004543.GB22483>