Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 1260 invoked from network); 16 Sep 2002 16:15:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Sep 2002 16:15:44 -0000 Received: (qmail 25350 invoked by uid 97); 16 Sep 2002 16:16:16 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 25334 invoked by uid 97); 16 Sep 2002 16:16:16 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 25322 invoked by uid 98); 16 Sep 2002 16:16:15 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Subject: [Fwd: Remove empty lines from a file?] From: Davor Cengija To: Ant Users List Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 16 Sep 2002 18:15:23 +0200 Message-Id: <1032192924.3188.25.camel@lothar.cengija.com> Mime-Version: 1.0 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hehe, mail manager works just fine. Sorry if this message appears twice. -----Forwarded Message----- From: Davor Cengija To: Ant Users List Subject: Remove empty lines from a file? Date: 16 Sep 2002 17:35:57 +0200 I'm looking for a task which will remove all empty lines from a file. Searching the mail archives I found some mentionings of replaceregexp task, but I cannot force it to work as I wish. I wrote my own custom task (first ever, I stared using Ant yesterday :-) but it is rather cumbersome: it creates a temporary file, copies the non-empty lines to it and then calls java.io.File#rename(). I'd be much more happier with 'native' ant task, probably without temp files. I'm using Ant 1.5.0 stable (+jakarta-oro-2.0.6 I think) Any help is greatly appreciated. Thanks! P.S. Maybe I don't need removeemptylines task at all if I knew how to use replaceregexp properly. I need to prepare some database dumps for the distribution. Those dumps contains table definitions, as well as the INSERT INTO lines. When I strip down those INSERT INTO lines, I have a file with a few thousands of empty lines which I just don't want to be there. This is how I use replaceregexp: Regexp is matched but CR/LF remains regardes of the flag I use. One important issue: when the first INSERT INTO is encountered, everything after that until the end of file can be stripped. Is the replaceregexp the solution for my problem? Thanks again :-) -- To unsubscribe, e-mail: For additional commands, e-mail: