newline
! ;; self-insert-command
Stefan
-Original Message-
From: _brian_d_foy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 06, 2001 5:46 PM
To: [EMAIL PROTECTED]
Subject: Re: perl script to remove control M's
In article <OFC37CFF55.39E829E6-ON86256B1A.004E73D7@com>
In article ,
[EMAIL PROTECTED] (Brent Michalski) wrote:
> I always like to simply use:
>
> perl -pi -e 's/\r//'
you have to be careful with that though because it's not
portable. \r means different things to different OSes :)
perl -pi -e 's/\
I always like to simply use:
perl -pi -e 's/\r//'
I have this line posted im my work-area, along with the Java solution...
The Java solution is > 40 lines and imports several libraries...
Brent
On Wed, 5 Dec 2001, Chris Spurgeon wrote:
> perl -i.bak -npe 's/\r\n/\n/g'
You don't need to use -n and -p together, -p does the same as -n, but
prints the line.
-- Brett
http://www.chapelperilous.net/
--
t;
> Hth. Sid.
>
> -Original Message-
> From: Chris Spurgeon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 5:41 PM
> To: 'Booher Timothy B 1stLt AFRL/MNAC'; [EMAIL PROTECTED]
> Subject: RE: perl script to remove control M's
>
>
> per
215.922.3880
-Original Message-
From: Sidharth Malhotra [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 5:50 PM
To: Chris Spurgeon; 'Booher Timothy B 1stLt AFRL/MNAC';
[EMAIL PROTECTED]
Subject: RE: perl script to remove control M's
Most unix systems have a program
/MNAC'; [EMAIL PROTECTED]
Subject: RE: perl script to remove control M's
perl -i.bak -npe 's/\r\n/\n/g'
where is the filename you want to clean.
A backup copy of your original file will be created in the same
directory with a ".bak" extension.
__
perl -i.bak -npe 's/\r\n/\n/g'
where is the filename you want to clean.
A backup copy of your original file will be created in the same directory
with a ".bak" extension.
Chris Spurgeon
Senior Design Technologist
[EMAIL PROTECTED]
ELECTRONIC INK
One South Broad Street
19t
On Wed, 5 Dec 2001, Booher Timothy B 1stLt AFRL/MNAC wrote:
> I have what seems to be a persistent problem with all files that I import
> from dos into emacs. I have those control M's all over the place.
>
> Does anyone know of a perl script to 'clean' these files?
You can do this in one line:
#!/usr/bin/perl -i
while (<>) {
/\n/g;;
print $_;
}
--
Namaste,
Kristin
"The universe seems neither benign nor hostile, merely indifferent."
- Carl Sagan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
10 matches
Mail list logo