On Tue, 3 Dec 2002, D J Hawkey Jr wrote:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
It's a bit easier if you let Perl do the heavy lifting:
perl -pi -e 's/\r//g' file-to-convert
Even easier (and lighter) if you ditch the perl:
sed -e 's/\r//g' input output
... Much deleted ...
Ack. Looks like you're right, and I agree with you. If [2addr]l can output
'\r', [2addr]s/regex/repl/flags ought to understand \r. I have to wonder
how many times I may have been bitten by this mis-feature. ;-,
This'll work though:
sed -e 's/[[:cntrl:]]$//g'
On Dec 04, at 10:20 AM, Jerry McAllister wrote:
This'll work though:
sed -e 's/[[:cntrl:]]$//g'
I like the tr(1) conversion too, but I always seem to think in terms of
sed(1) and awk(1).
And if that sed(1) solution is still too loose, the tr(1) solution reduces
Any ideas in re to subject ?
/thomas
--
Thomas von Hassel
DarX @ irc
darxmac @ AIM/iChat
Powered by inkwell...!
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message
S)ubject: Re: tool/method to convert DOS line endings to UNIX line endings
Any ideas in re to subject ?
First of all, please put all relevant information in the body of your
message. It makes it very difficult to read and impossible to quote
things that are only mentioned in the subject line
On Tuesday, December 3, 2002, at 10:11 PM, Jerry McAllister wrote:
If you are moving th efiles, use ftp in ASCII mode. It will then
do the conversion for you. After you make the ftp connection and
before GETting or PUTting the file, type ASCII to select ASCII mode.
that doesnt work, tried
PROTECTED]
Subject: Re: tool/method to convert DOS line endings to UNIX line
endings
On Tuesday, December 3, 2002, at 10:11 PM, Jerry McAllister wrote:
If you are moving th efiles, use ftp in ASCII mode. It will then
do the conversion for you. After you make the ftp connection
If you are going from DOS to Unix you could use the following perl script:
#!/usr/bin/perl -w
use strict;
my $pcfile = shift || /tmp/dosfile.txt ;
my $outfile = shift || /tmp/unixconverted.txt;
die Cannot read $pcfile... unless -r $pcfile;
open(IN, $pcfile) or die Cannot open $pcfile: $!;
On Tue, 3 Dec 2002, Lee J Carmichael wrote:
If you are going from DOS to Unix you could use the following perl script:
[script snipped]
It's a bit easier if you let Perl do the heavy lifting:
perl -pi -e 's/\r//g' file-to-convert
-Warren Block * Rapid City, South Dakota USA
To
Good point, I pulled it from a script that was doing some additional
magic.
Lee
On Tue, 3 Dec 2002, Warren Block wrote:
On Tue, 3 Dec 2002, Lee J Carmichael wrote:
If you are going from DOS to Unix you could use the following perl script:
[script snipped]
It's a bit easier if you
tr(1), ports/converters/dosunix,ports/converters/unix2dos
LER
--On Tuesday, December 03, 2002 21:59:03 +0100 Thomas von Hassel
[EMAIL PROTECTED] wrote:
Any ideas in re to subject ?
/thomas
--
Thomas von Hassel
DarX @ irc
darxmac @ AIM/iChat
Powered by inkwell...!
To Unsubscribe: send
On Tuesday, December 3, 2002, at 10:11 PM, Jerry McAllister wrote:
If you are moving th efiles, use ftp in ASCII mode. It will then
do the conversion for you. After you make the ftp connection and
before GETting or PUTting the file, type ASCII to select ASCII mode.
that doesnt
On Wednesday, December 4, 2002, at 12:09 AM, Jerry McAllister wrote:
On Tuesday, December 3, 2002, at 10:11 PM, Jerry McAllister wrote:
If you are moving th efiles, use ftp in ASCII mode. It will then
do the conversion for you. After you make the ftp connection and
before GETting or
At 2002-12-03T21:53:29Z, Lee J Carmichael [EMAIL PROTECTED] writes:
while(IN) {
chomp;
print OUT \n;
}
Wouldn't that print only an EOL? Shouldn't that be:
print OUT $_\n;
or similar?
--
Kirk Strauser
In Googlis non est, ergo non est.
To Unsubscribe: send mail to [EMAIL
[Posted and mailed]
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] writes:
On Tue, 3 Dec 2002, Lee J Carmichael wrote:
If you are going from DOS to Unix you could use the following perl script:
[script snipped]
It's a bit easier if you let Perl do the heavy lifting:
perl
15 matches
Mail list logo