RE: How to remove ^M character

2003-08-04 Thread Munden, Randall J
Or, if you've perl available:

perl -pi -e 's/\r\n/\n/;' [file name]

-Original Message-
From: C Peter Biessener [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 04, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: Re: How to remove ^M character


You can also use ASCII mode in ftp, it will translate the line ends for 
you.  BINARY mode is for programs and archive files (zip, tar, tgz,
etc...)

Simon Barner wrote:
> Hi,
> 
> 
>>I ftp'd a file from windows to freebsdnot its every line has ^M at

>>its end. Is there some command in vi (or some way) by whcih ^M can be 
>>removed.
> 
> 
> You can use dos2unix(1) for that. There is also the complementary tool

> unix2dos(1).
> 
> Simon

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
"[EMAIL PROTECTED]"
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-04 Thread C Peter Biessener
You can also use ASCII mode in ftp, it will translate the line ends for 
you.  BINARY mode is for programs and archive files (zip, tar, tgz, etc...)

Simon Barner wrote:
Hi,


I ftp'd a file from windows to freebsdnot its every line has ^M at its
end.
Is there some command in vi (or some way) by whcih ^M can be removed.


You can use dos2unix(1) for that. There is also the complementary tool
unix2dos(1).
Simon
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-02 Thread Bill Campbell
On Sat, Aug 02, 2003 at 02:49:40PM +0530, Shantanu Mahajan wrote:
>+-- Anil Garg [freebsd] [01-08-03 14:01 +0530]:
>| Hi,
>| 
>| I ftp'd a file from windows to freebsdnot its every line has ^M at its
>| end.
>| Is there some command in vi (or some way) by whcih ^M can be removed.

In the future when doing the transfer, make sure your ftp program is in
text mode, not binary, and it should take care of this conversion.

>| Thanks
>| Anil
>
>   col -bx < oldfile > newfile
>
>   Regards,
>   Shantanu
>___
>[EMAIL PROTECTED] mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>

-- 
Bill
--
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
UUCP:   camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

Government is actually the worst failure of civilized man. There has
never been a really good one, and even those that are most tolerable
are arbitrary, cruel, grasping and unintelligent.
-- H. L. Mencken
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-02 Thread Shantanu Mahajan
+-- Anil Garg [freebsd] [01-08-03 14:01 +0530]:
| Hi,
| 
| I ftp'd a file from windows to freebsdnot its every line has ^M at its
| end.
| Is there some command in vi (or some way) by whcih ^M can be removed.
| 
| Thanks
| Anil

col -bx < oldfile > newfile

Regards,
Shantanu
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread parv
in message <[EMAIL PROTECTED]>,
wrote Paul Beard thusly...
>
> got room for one more? 
> 
> perl -pi -e s#\\r#\\n#g 

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/

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Paul Beard
 
On Friday, August 01, 2003, at 01:31AM, Anil Garg <[EMAIL PROTECTED]> wrote:

>Hi,
>
>I ftp'd a file from windows to freebsdnot its every line has ^M at its
>end.
>Is there some command in vi (or some way) by whcih ^M can be removed.
>

got room for one more? 

perl -pi -e s#\\r#\\n#g 

--
Paul Beard / 8040 27th Ave NE / Seattle WA 98115 /
paulbeard [at] mac [ dot] com / 206 529 8400

weblog @ 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Kevin Kinsey
On Fri, Aug 01, 2003 at 02:01:18PM +0530, Anil Garg wrote:
> Hi,
> 
> I ftp'd a file from windows to freebsdnot its every line has ^M at its
> end. Is there some command in vi (or some way) by whcih ^M can be removed.
> 
> Thanks
> Anil
> 
YAW (yet another way...)

sed 's/.$//' infile.txt > outfile.txt


KDK
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Adam
On Fri, 2003-08-01 at 04:31, Anil Garg wrote:
> I ftp'd a file from windows to freebsdnot its every line has ^M at its
> end.
> Is there some command in vi (or some way) by whcih ^M can be removed.

In general, you can use a tool such as converters/unix2dos

However, in regards to FTP, you simply need to transfer text files in
ASCII mode, so that the ^M's are automatically removed.

-- 
Adam <[EMAIL PROTECTED]>

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Simon Barner
Hi,

> I ftp'd a file from windows to freebsdnot its every line has ^M at its
> end.
> Is there some command in vi (or some way) by whcih ^M can be removed.

You can use dos2unix(1) for that. There is also the complementary tool
unix2dos(1).

Simon


signature.asc
Description: Digital signature


RE: How to remove ^M character

2003-08-01 Thread Philip Payne
HI,
> I ftp'd a file from windows to freebsdnot its every line 
> has ^M at its
> end.
> Is there some command in vi (or some way) by whcih ^M can be removed.
> 
> Thanks
> Anil

At the vi command line
:1,$:s/http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Anil Garg
thanks :)
- Original Message -
From: "Karl Pielorz" <[EMAIL PROTECTED]>
To: "Anil Garg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 2:07 PM
Subject: Re: How to remove ^M character


>
>
> --On 01 August 2003 14:01 +0530 Anil Garg <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > I ftp'd a file from windows to freebsdnot its every line has ^M at
its
> > end.
> > Is there some command in vi (or some way) by which ^M can be removed.
>
> Or, on second thoughts - upload it via ftp in ASCII mode, not binary
mode -
> and the system should do it for you... :)
>
> -Kp
>


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Karl Pielorz


--On 01 August 2003 14:01 +0530 Anil Garg <[EMAIL PROTECTED]> wrote:

Hi,

I ftp'd a file from windows to freebsdnot its every line has ^M at its
end.
Is there some command in vi (or some way) by which ^M can be removed.
man tr

or simply,

cat file | tr -d "\r" > newfile

-Kp
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to remove ^M character

2003-08-01 Thread Karl Pielorz


--On 01 August 2003 14:01 +0530 Anil Garg <[EMAIL PROTECTED]> wrote:

Hi,

I ftp'd a file from windows to freebsdnot its every line has ^M at its
end.
Is there some command in vi (or some way) by which ^M can be removed.
Or, on second thoughts - upload it via ftp in ASCII mode, not binary mode - 
and the system should do it for you... :)

-Kp
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


How to remove ^M character

2003-08-01 Thread Anil Garg
Hi,

I ftp'd a file from windows to freebsdnot its every line has ^M at its
end.
Is there some command in vi (or some way) by whcih ^M can be removed.

Thanks
Anil


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"