Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <17B78BDF120BD411B70100500422FC6309E1EA@IIS000> From: Bernard Dautrevaux To: "'bkeener AT thesoftwaresource DOT com'" , cygwin Subject: RE: How do I remove CR/LF from text file Date: Fri, 2 Feb 2001 18:54:43 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" > -----Original Message----- > From: Brian Keener [mailto:bkeener AT thesoftwaresource DOT com] > Sent: Friday, February 02, 2001 7:03 PM > To: cygwin > Subject: Re: How do I remove CR/LF from text file > > > Larry Hall wrote: > > How about piping it through tr, mapping \n to \r\n? > > > I can't seem to get tr to exchange more than one character since I am > only starting with one character. > > tr "[\n]" "[\n\r]" < /tmp/foo >/windows/temp/foo2 no > apparent change > > tr "[\n]" "[\r]" < /tmp/foo >/windows/temp/foo2 No apparent > change when > looking in Notepad > > tr "[\n]" "[~]" < /tmp/foo >/windows/temp/foo2 all then newlines > changed to ~ > > Got any idea what I am doing wrong - I don't see any other flags or > switches that might make a difference. Can't you directly generate your file as DOS text? either by writing on a text-mount, or by explicitely writing to a file opened in text mode, by open("...", O_WRONLY|O_TEXT) or fopen("...", "wt"); As you decribe the problem (wordpad understand the file but notepad displays black rectangles instead of the EOL I think), you need not convert to UNIX from DOS but the other way round: native Windows programs need CF/LF line terminations -- at least old buggy ones like bug^H^H^Hnotepad :-) HTH Bernard -------------------------------------------- Bernard Dautrevaux Microprocess Ingenierie 97 bis, rue de Colombes 92400 COURBEVOIE FRANCE Tel: +33 (0) 1 47 68 80 80 Fax: +33 (0) 1 47 88 97 85 e-mail: dautrevaux AT microprocess DOT com b DOT dautrevaux AT usa DOT net -------------------------------------------- -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple