Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <200310231511.RAA29644@trantor.eads-dsn.com> From: "david.liberce" To: "DePriest, Jason R." , cygwin AT cygwin DOT com Subject: RE: bash- Removing Line feeds (Carriage returns) from data Date: Thu, 23 Oct 2003 17:12:32 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal In-Reply-To: <03C99898510C8C47945B932907D99AAA16F037@E2KMEMMCS1.ftbco.ftn.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal when I have problems like this, I pipe the standard output into a little perl inliner that replaces all trailing space characters with a single \n, like this: poide:~> programmThatDoSomeStuff.exe | perl -pe 's/\s*$/\n/' Hope it helps, David -----Message d'origine----- De : DePriest, Jason R. [mailto:jrdepriest AT ftb DOT com] Envoye : Thursday, October 23, 2003 4:45 PM A : cygwin AT cygwin DOT com Objet : RE: bash- Removing Line feeds (Carriage returns) from data > -----Original Message----- > From: cygwin-owner AT cygwin DOT com > [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Jared Ingersoll > Sent: Thursday, October 23, 2003 9:33 AM > To: 'cygwin AT cygwin DOT com' > Subject: bash- Removing Line feeds (Carriage returns) from data > > > Hello, > > I'm currently using cygwin (updated yesterday) with a WIN2K > resource kit > utility to dump logs from event viewer into a comma delimited > file. One > behavior that I have noticed (and occasionally notice with cygwin in > general) is that within the data, there are what I believe to > be carriage > returns (show up in an excel spreadsheet as a square > character). This data > will eventually end up in an Oracle database, so these characters are > undesirable. I was wondering if there is a way (outside of > manually editing > the file, perhaps with sed or awk) to remove these characters? > > Here's the command that's producing them in the bash shell: > > /cygdrive/d/EventAudit/dumpel.exe -d 1 -s MyPC -l system -t -c | > /cygdrive/c/cygwin/bin/awk '{print "MyPC" "," "system" "," $0}' >> > /cygdrive/d/EventAudit/serverevents.`/cygdrive/c/cygwin/bin/da > te +%Y%m%d` > > I was unable to find any reference to an automated resolution > on google or > cygwin FAQ. > > Thanks for the help. > > Jared See if 'dos2unix' from the 'cygutils' package does what you need. -Jason -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/