Re: Removing ^M
| From: | Michael Hall | Date: | Sun, 09 Jun 2002 01:29:35 +0000 |
| Subject: | Re: Removing ^M | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101326@lists.php.net to get a copy of this message | ||
As a result of my original request, I now have half a dozen ways of doing
this using php, perl, python and tr :)
I guess this is sort of on topic because there may be PHP
programmers who want to do this without writing a PHP script that
probably has to be run by a web server.
Anyway, someone on the Python list suggested this variety of tr:
tr -d '\015' <infile >outfile
I haven't tested this. 015 is the numeric code for "\r".
Mick
On Sat, 8 Jun 2002, Steve Buehler wrote:
> I get this when running that command:
> tr: only one string may be given when deleting without squeezing repeats
>
>
> I looked at the tr man pages and it didn't help much. I also tried using
> '\r' and
\r and just \r , but always get the same
> result.
>
> Steve
>
> At 11:07 PM 6/8/2002 +0200, you wrote:
> >why not just run
> > tr -d "\r" htmlfile.htm
> >
> >
> >----- Original Message -----
> >From: "Michael Hall" <olc@ninti.com>
> >To: "PHP List" <php-general@lists.php.net>
> >Sent: Sunday, June 09, 2002 2:40 AM
> >Subject: [PHP] Removing ^M
> >
> >
> > >
> > >
> > > I am trying remove ^M characters (some kind of newline character) from an
> > > HTML file. I've tried all sorts of ereg_replace and sed possibilities
> > > but the
> > > things just won't go away. Does anyone have a way of removing such
> > > characters?
> > >
> > > TIA
> > >
> > > Mick
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >--
> >This message has been scanned for viruses and
> >dangerous content by MailScanner, and is
> >believed to be clean.
> >ow3
>
>
>
>
--
--------------------------------
n i n t i . c o m
php-python-perl-mysql-postgresql
--------------------------------
Michael Hall ninti@ninti.com
--------------------------------