From owner-freebsd-questions@FreeBSD.ORG Tue Jan 4 13:06:10 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359C7106564A for ; Tue, 4 Jan 2011 13:06:10 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id BF29B8FC16 for ; Tue, 4 Jan 2011 13:06:09 +0000 (UTC) Received: by wwf26 with SMTP id 26so14080242wwf.31 for ; Tue, 04 Jan 2011 05:06:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=yVV1B7l9W6XqqNGBIvGNz8weirikRPsLeDPISX7J1Fo=; b=gSriuGTijaALscX1ABF2u/nZsbb5usYB9DX8RCReYNTsQI+/hzAdwTydBj4KjA+oJz IDr5Tj4OnhURTicsyAZPJRGn2ct6npO6WnqIox+fgygNhzmug6qZRT263wykRsqGyIn+ Pz6KMjI/B0RpNNVYklycb1UDDvft/nl63XHtQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=HCxoymFSpOJdhcKre238e9UKqj3dRpCCTj4Tgkh1OP888GlFn0UHAisaLp1wVfGPnN hznCRuW/rNwjH8DmaNu3Hxt2yhlAg0Ki8WqrNPLWr7YRBSfdddkNVsynGp1yvHHbk0q2 OojeMbYCKdhUanNK21ZzsHjV9nj6uuFaxYEvQ= MIME-Version: 1.0 Received: by 10.216.51.135 with SMTP id b7mr25289787wec.29.1294146368033; Tue, 04 Jan 2011 05:06:08 -0800 (PST) Received: by 10.216.72.198 with HTTP; Tue, 4 Jan 2011 05:06:07 -0800 (PST) In-Reply-To: <117654.42578.qm@web121409.mail.ne1.yahoo.com> References: <117654.42578.qm@web121409.mail.ne1.yahoo.com> Date: Tue, 4 Jan 2011 13:06:07 +0000 Message-ID: From: krad To: S Mathias Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: a perl question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:06:10 -0000 On 4 January 2011 10:32, S Mathias wrote: > cat asdf.txt > bla-bla > bla-bla > bla[XYZ] > importantthing > another important thing > [/XYZ] > bla-bla > bla-bla > [XYZ] > yet another thing > hello! > [/XYZ] > bla-bla > etc. > $ SOMEPERLMAGIC asdf.txt > output.txt > $ cat output.txt > importantthing > another important thing > yet another thing > hello! > > > how can i sovle this question? what is SOMEPERLMAGIC? are there any perl > gurus, that have a little spare time? > > Thank you! :\ > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > doesnt need to be perl either cat asdf.txt | awk 'BEGIN {a=0} { if ( $0 ~ /\[XYZ\]/ ) a=1; if ( $0 ~ /\[\/XYZ\]/ ) a=0; if ( a == 1) print $0}' or something close to it