From owner-freebsd-questions Tue Dec 3 13:53:34 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E516B37B401 for ; Tue, 3 Dec 2002 13:53:32 -0800 (PST) Received: from efw1.wamnet.com (efw1.wamnet.com [67.98.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE3D943EA9 for ; Tue, 3 Dec 2002 13:53:31 -0800 (PST) (envelope-from lcarmich@wamnet.com) Received: from ndm.wamnet.com ([172.17.38.2]) by efw1.wamnet.com (8.12.2/8.12.2) with ESMTP id gB3LrUrF013389; Tue, 3 Dec 2002 15:53:30 -0600 (CST) Received: from ds.cops.wamnet.com (ds.cops.wamnet.com [172.17.31.2]) by ndm.wamnet.com (8.9.1a/8.9.1) with ESMTP id PAA142516; Tue, 3 Dec 2002 15:53:30 -0600 (CST) Received: from y.dev.wamnet.com (y.dev.wamnet.com [172.17.27.37]) by ds.cops.wamnet.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via SMTP id PAA44345; Tue, 3 Dec 2002 15:53:29 -0600 (CST) Date: Tue, 3 Dec 2002 15:53:29 -0600 (CST) From: Lee J Carmichael X-Sender: lcarmich@y.dev.wamnet.com To: Thomas von Hassel Cc: freebsd-questions@FreeBSD.ORG Subject: Re: tool/method to convert DOS line endings to UNIX line endings In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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: $!"; open(OUT, ">$outfile") or die "Cannot open $outfile: $!"; $/ = "\r"; ## pc end of line, damn gates while() { chomp; print OUT "\n"; } ## should really check the close of these but... close(IN); close(OUT); exit; -------- Lee Carmichael Service Architect - WorkSpace WAM!NET Inc. 655 Lone Oak Rd Building A Eagan, MN 55121 ph# 651-256-5292 email: lcarmich@wamnet.com On Tue, 3 Dec 2002, Thomas von Hassel 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 PUTting the file, type ASCII to select ASCII mode. > > that doesnt work, tried diferent ftp clients both getting and putting > the files ... > > /thomas > > > -- > Thomas von Hassel > DarX @ irc > darxmac @ AIM/iChat > Powered by inkwell...! > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message