Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 14663 invoked from network); 4 Aug 2008 22:46:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Aug 2008 22:46:00 -0000 Received: (qmail 47052 invoked by uid 500); 4 Aug 2008 22:45:57 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 47018 invoked by uid 500); 4 Aug 2008 22:45:57 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 47007 invoked by uid 99); 4 Aug 2008 22:45:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 15:45:57 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 22:45:01 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KQ8nv-0002qZ-Gm for user@ant.apache.org; Mon, 04 Aug 2008 15:45:27 -0700 Message-ID: <18821371.post@talk.nabble.com> Date: Mon, 4 Aug 2008 15:45:27 -0700 (PDT) From: srimh2o To: user@ant.apache.org Subject: Re: Split lines in input stream In-Reply-To: <222008.49055.qm@web55105.mail.re4.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sriram@mh2o.com References: <18814904.post@talk.nabble.com> <18815844.post@talk.nabble.com> <18816107.post@talk.nabble.com> <497917.33964.qm@web55106.mail.re4.yahoo.com> <18819201.post@talk.nabble.com> <222008.49055.qm@web55105.mail.re4.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks again, that worked better. Matt Benson wrote: > > > --- srimh2o wrote: > >> >> Thanks, that worked. >> >> This is not just for testing purposes. My piece of >> build.xml looks like >> this: >> >> > destfile="testing.jad">${attrib} >> >> >> > to="${line.separator}"/> >> >> >> >> >> >> > > The way you've got this arranged, the line > tokenization takes place before the string > replacement. is the default tokenizer > used by token filters, so you could simplify your > invocation to: > > append="true">${attrib} > > to="${line.separator}"/> > > > > > You might even want to add an after > the trim as well, depending on your requirements. > > -Matt > >> ${attrib} is loaded with a string from a file that >> contains "||" as a marker >> for build.xml to know that this is a new line. But >> curiously, the output >> file testing.jad contains 2 spaces after the last >> line. I can't figure out >> where they are getting inserted. does not >> seem to get rid of them. >> Any suggestions? >> >> Thanks for your help. >> >> >> Matt Benson wrote: >> > >> > >> > --- srimh2o wrote: >> > >> >> >> >> If this is complicated is there any way I can >> insert >> >> a linebreak between >> >> Hello and World? >> > >> > If you're just doing this for testing purposes, >> Ant >> > loads all Java system properties, so you can >> insert >> > your platform separator by simply embedding >> > ${line.separator}. >> > >> > -Matt >> > >> >> >> >> srimh2o wrote: >> >> > >> >> > Ahh, this is verbatim, but you are correct. The >> >> \r\n does not substitute >> >> > for CRLF (0x0d, 0x0a). Then what I would like >> to >> >> do is somehow specify >> >> > Hello world and then get the output as: >> >> > Hello >> >> > World >> >> > >> >> > Any suggestions on how to do this? >> >> > >> >> > Thanks. >> >> > >> >> > >> >> > Scot P. Floess wrote: >> >> >> >> >> >> Is this verbatim? If so,, part of your >> problem >> >> is the literal characters >> >> >> \r and \n are note the escaped counterparts... >> >> >> >> >> >> Meaning if I had this: >> >> >> >> >> >> Hello r n World >> >> >> >> >> >> The r and the n are literals...and you'd see >> the >> >> same output as you are >> >> >> seeing now... >> >> >> >> >> >> >> >> >> >> >> >> On Mon, 4 Aug 2008, srimh2o wrote: >> >> >> >> >> >>> >> >> >>> Hi, >> >> >>> >> >> >>> I have a string input that contains carriage >> >> return "\r\n" and I'd like >> >> >>> to >> >> >>> use ant to split that input into two separate >> >> lines. This is what I do. >> >> >>> >> >> >>> > >> destfile="testing.jad">Hello \r\n World >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> I'd like the output to look like this: >> >> >>> Hello >> >> >>> World >> >> >>> >> >> >>> Instead i get this: >> >> >>> Hello \r\n World >> >> >>> >> >> >>> Please help. >> >> >>> >> >> >>> Thanks >> >> >>> -- >> >> >>> View this message in context: >> >> >>> >> >> >> > >> > http://www.nabble.com/Split-lines-in-input-stream-tp18814904p18814904.html >> >> >>> Sent from the Ant - Users mailing list >> archive >> >> at Nabble.com. >> >> >>> >> >> >>> >> >> >>> >> >> >> > >> > --------------------------------------------------------------------- >> >> >>> To unsubscribe, e-mail: >> >> user-unsubscribe@ant.apache.org >> >> >>> For additional commands, e-mail: >> >> user-help@ant.apache.org >> >> >>> >> >> >>> >> >> >> >> >> >> Scot P. Floess >> >> >> 27 Lake Royale >> >> >> Louisburg, NC 27549 >> >> >> >> >> >> 252-478-8087 (Home) >> >> >> 919-754-4592 (Work) >> >> >> >> >> >> Chief Architect JPlate >> >> http://sourceforge.net/projects/jplate >> >> >> Chief Architect JavaPIM >> >> http://sourceforge.net/projects/javapim >> >> >> >> >> >> Architect Keros >> >> http://sourceforge.net/projects/keros >> >> >> >> >> >> >> >> >> > >> > --------------------------------------------------------------------- >> >> >> To unsubscribe, e-mail: >> >> user-unsubscribe@ant.apache.org >> >> >> For additional commands, e-mail: >> >> user-help@ant.apache.org >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> > >> > http://www.nabble.com/Split-lines-in-input-stream-tp18814904p18816107.html >> >> Sent from the Ant - Users mailing list archive at >> >> Nabble.com. >> >> >> >> >> >> >> > >> > --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: >> >> user-unsubscribe@ant.apache.org >> >> For additional commands, e-mail: >> >> user-help@ant.apache.org >> >> >> >> >> > >> > >> > >> > >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: >> user-unsubscribe@ant.apache.org >> > For additional commands, e-mail: >> user-help@ant.apache.org >> > >> > >> > >> >> -- >> View this message in context: >> > http://www.nabble.com/Split-lines-in-input-stream-tp18814904p18819201.html >> Sent from the Ant - Users mailing list archive at >> Nabble.com. >> >> >> > --------------------------------------------------------------------- >> To unsubscribe, e-mail: >> user-unsubscribe@ant.apache.org >> For additional commands, e-mail: >> user-help@ant.apache.org >> >> > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > > -- View this message in context: http://www.nabble.com/Split-lines-in-input-stream-tp18814904p18821371.html Sent from the Ant - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org