Simplest way to translate file formats.

Frank Cusack fcusack@iconnet.net
Wed Nov 11 02:01:00 GMT 1998


Actually, \n in perl translates to the "end of line" character in
whatever platform you are on. For translations like this, you
should instead use \015 and \012 .

~frank

In message < 03F4742D8225D21191EF00805FE62B9993C69E@mail.medstat.com >, 
John Wiersba writes:
> If you have perl, you could try this script, which is what I use:
> 
> #!/bin/bash
> perl -pe 's/\r?(\n?)\x1a?$/\1/' "$@"
> 
> This is meant to replace any combination of the characters CR LF ^Z (in
> that order) at the end of a line with a LF (newline).
> 
> John Wiersba (john.wiersba@medstat.com)
> 
> -----Original Message-----
> From: Chris Searle [ mailto:chris@searle1.demon.co.uk ]
> Sent: Thursday, November 05, 1998 1:09 PM
> To: gnu-win32@cygnus.com
> Subject: Simplest way to translate file formats.
> 
> 
> I've brought down a couple of tarballs for various ported apps for
> cygwin, and some have LF line terminated files, some have CR LF files.
> Now, all my mounts are binary, and configure barfs on CR LF.
> 

[...]

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list