Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 398DC200B92 for ; Wed, 28 Sep 2016 13:04:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 382BD160AD4; Wed, 28 Sep 2016 11:04:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5770F160AB4 for ; Wed, 28 Sep 2016 13:04:43 +0200 (CEST) Received: (qmail 65931 invoked by uid 500); 28 Sep 2016 11:04:42 -0000 Mailing-List: contact users-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@nifi.apache.org Delivered-To: mailing list users@nifi.apache.org Received: (qmail 65915 invoked by uid 99); 28 Sep 2016 11:04:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2016 11:04:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D53CCCA27C for ; Wed, 28 Sep 2016 11:04:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.276 X-Spam-Level: **** X-Spam-Status: No, score=4.276 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=2.397, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Ls4y7K3o_y7a for ; Wed, 28 Sep 2016 11:04:38 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 651C95FB18 for ; Wed, 28 Sep 2016 11:04:37 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id l131so47651723lfl.2 for ; Wed, 28 Sep 2016 04:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=bscaGnoKNovdsyt+MmWRfFOdgNFNv2G8/tJ962NiHMU=; b=Tnody8vvtv6YeNqile/mvX1aF1pZWr3Hp782H9nHAT9uhpbwmKsCRcZRzq7gxx9hwu 1wU38sNDQii/uh3WSPWYD0Q/Xt+MhFnKhVuHBGaTxI1olFTnFrTD/qwtnVvVbfkXQ10L BHf2KKKtYtBarVvwD1722n2H3SPRshbB2xOMbhmctqWlahgSy3s7LAlPgF0TYcouhAQM /cGdMjkfkAWhH+/tuF5DzXIsxwAjqPNxfgij7XE8wG558K8JuyfeDIOGBwLY3w6s1D9B dYa3+FBkagdHdOpVjW945PLh79HbcJitSi1wHAoMdHQ/IgWAfIKLep0z2r97zCq+SoBz Xtww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=bscaGnoKNovdsyt+MmWRfFOdgNFNv2G8/tJ962NiHMU=; b=SG82esGpSrvtHXe2/Eas6vUYMwfBwqaDM20c0YRNcvZIdaPTAmejWmTrN36YXlRLii wrsRd4y1ofo0yuRI3q43oDgZ6ZyiUHNoCQqFVt7fJ+nSI2IDZ7ZbJMV6Job54eQAiMBI j8VAsB3z4vR79WqMXPRrGmKwOxzlYyM/+al4sUNhn48IfxQshYFx7HJ6Wh47hwjRGf4A mcDfv06oPBxaxoOPtFCpN/Krl0EC3Gd2zverg5P9i9ODTNdO/v/ZqofVu27KeBNwaQ/I Cc9W/pehniBwxAi2poVUOxps5Y3UltSSvodIWXVStUBqFQYbrADNRgif9Fq8NtsrsiEH mN4g== X-Gm-Message-State: AE9vXwOuD8j8W0XnpEZjBSE5jHrVfrpU2ruV8lFMSTlGXskYpq8h+QAmIMQFFTEz81G7b1ZryaejPTFMX0ofMA== X-Received: by 10.194.176.229 with SMTP id cl5mr26379495wjc.107.1475060676722; Wed, 28 Sep 2016 04:04:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.26.7 with HTTP; Wed, 28 Sep 2016 04:03:56 -0700 (PDT) In-Reply-To: References: <7ca1df986dcc4d5da0c786e2cf0fcfaf@bowex17e.micron.com> From: Pierre Villard Date: Wed, 28 Sep 2016 13:03:56 +0200 Message-ID: Subject: Re: Remove top N lines from a text file To: users@nifi.apache.org Content-Type: multipart/alternative; boundary=089e0103e520a889b8053d8f53c9 archived-at: Wed, 28 Sep 2016 11:04:44 -0000 --089e0103e520a889b8053d8f53c9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Peter, I would recommend you the following blog by Matt: http://funnifi.blogspot.fr/2016/02/executescript-processor-replacing-flow.h= tml Pierre 2016-09-28 13:01 GMT+02:00 Andrew Grande : > Groovy script or a simple sed command invoked via ExecuteStreamingCommand > should do the job. > > Andrew > > On Wed, Sep 28, 2016, 12:18 AM Peter Wicks (pwicks) > wrote: > >> I have a CSV file where the first few lines are a summary of the report >> parameters that were used to generate it. I want to strip these off in N= iFi. >> >> I=E2=80=99ve considered using a RegEx to match the {N} top lines, but am >> wondering of a Groovy script might be a better option? I want to keep t= he >> file intact, so splitting it by line ending and routing all of the lines >> through a RouteByAttribute seems excessive. >> >> >> >> I=E2=80=99ve never built a Groovy script, any examples on how I might go= about >> this? >> >> >> >> Thanks, >> >> Peter >> > --089e0103e520a889b8053d8f53c9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Peter,

I would recommend you the= following blog by Matt:
http://funnifi.blogspot.fr/2016= /02/executescript-processor-replacing-flow.html

Pierre
=

2016-09-28 = 13:01 GMT+02:00 Andrew Grande <aperepel@gmail.com>:

Groovy script or a simple sed com= mand invoked via ExecuteStreamingCommand should do the job.

Andrew


On Wed, Sep 28, 2016, 12:18= AM Peter Wicks (pwicks) <pwicks@micron.com> wrote:

I have a CSV file where the first few lines are a su= mmary of the report parameters that were used to generate it. I want to str= ip these off in NiFi.

I=E2=80=99ve considered using a RegEx to match the {= N} top lines, but am wondering of a Groovy script might be a better option?= =C2=A0 I want to keep the file intact, so splitting it by line ending and r= outing all of the lines through a RouteByAttribute seems excessive.

=C2=A0

I=E2=80=99ve never built a Groovy script, any exampl= es on how I might go about this?

=C2=A0

Thanks,

=C2=A0 Peter


--089e0103e520a889b8053d8f53c9--