Re: Carriage return.
| From: | Jon Farmer | Date: | Wed, 05 Sep 2001 09:44:23 +0000 |
| Subject: | Re: Carriage return. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66020@lists.php.net to get a copy of this message | ||
> My php script is generating a file that is saved in Unix format.
> I automatically get the "^M" in the end of everyline. Is there a way
> of saving this without getting the "^M" in the end of each line?
/usr/bin/perl -npe 's/\r\n/\n/g' filename
will remove the Ctrl-M characters for you. You could call it straight after
the line that generates the file.
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07968 524175
PGP Key available, send blank email to pgpkey@bctech.co.uk