Return-Path: X-Original-To: apmail-nifi-users-archive@minotaur.apache.org Delivered-To: apmail-nifi-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9FC2918456 for ; Sun, 31 Jan 2016 04:28:02 +0000 (UTC) Received: (qmail 61970 invoked by uid 500); 31 Jan 2016 04:28:02 -0000 Delivered-To: apmail-nifi-users-archive@nifi.apache.org Received: (qmail 61937 invoked by uid 500); 31 Jan 2016 04:28:02 -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 61927 invoked by uid 99); 31 Jan 2016 04:28:02 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jan 2016 04:28:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E623BC0185 for ; Sun, 31 Jan 2016 04:28:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.101 X-Spam-Level: X-Spam-Status: No, score=-0.101 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id JMB_ulrpgUdt for ; Sun, 31 Jan 2016 04:27:55 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 4A415258DB for ; Sun, 31 Jan 2016 04:27:54 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id h5so13352902igh.0 for ; Sat, 30 Jan 2016 20:27:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=JYrCvfCbjjaZNIzivJ5CWYRDJAh2Rg05Kg+AV5gVSPc=; b=OXk3iSRZZs5cfRwH8uZfamvGM0HgthOY+l3JMXPe/BlN+VP1Ak5AjrPT4z0RDaMl+j UBRs63Yhudgth+JE3pnVvP3gf4Hs2CLICcvaKYXMrdPpIMtZS3CI0INSX9K5vvcHyq22 +7dyC3vUm0HIl8lJlXKY9imMfEY/vMUbskS8vpPlWN7x1UK+HqGKwoGd/nKQQhZKOS5u OBx65J3mbznL/7n8SO9RYGjQvdeSQAVPrneE0zRXf3C5a6jhJfDxlAg6jwAd6N34w+hE j8Xd4s/dBE/7ZfnW5ZeZrmNv9jYqCtdhA0ny+jlDBiEcKJpR3xoeZXxFD3e0p4Rsa/hA zAfA== 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:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=JYrCvfCbjjaZNIzivJ5CWYRDJAh2Rg05Kg+AV5gVSPc=; b=PyzRDC5rt3DEw2ABSBjcIWsozzu5U1qxNgsaXNJWfTeauAwKoajdqSjXXV/ur6MaJ5 nwHfENwYBQwypZc7AdK75k1Nj56ij5kmnFx04oQkCqFPDY0NsSg+bxJvROAPbhsD9s0L 7XH999vIhtB0SViiJDWDIHhMAI9IXAp7uEePzpg80FoBgfVdeicY6LX7LrjlbHGPclhG UR/mF5civh94wg20wdm37TbBD25TZoszz916Z5CdT0B7TCAbDCPJfBCSYrUJHQ2RkGY/ 1P6BrSFRgFJNBET+h5H+M4bl5t2Cl0Qewt+HIDhfYcylAx+cXULgHfgC9kiPCT3Wj+oE K0hQ== X-Gm-Message-State: AG10YOQKVDRgJaTY8+FhBpU8fAbE0ph5Bz8KZ1fuukAgAYCdqzDJ450lEPtk+ul16Bn3+UPnTlA2z8eskmcOiA== MIME-Version: 1.0 X-Received: by 10.50.13.74 with SMTP id f10mr4440267igc.63.1454214467505; Sat, 30 Jan 2016 20:27:47 -0800 (PST) Received: by 10.36.219.65 with HTTP; Sat, 30 Jan 2016 20:27:47 -0800 (PST) In-Reply-To: <2b2f54db5eaa4d268c9e74b571c14ff9@SI-MBX1015.de.bosch.com> References: <2b2f54db5eaa4d268c9e74b571c14ff9@SI-MBX1015.de.bosch.com> Date: Sat, 30 Jan 2016 23:27:47 -0500 Message-ID: Subject: Re: Split header from CSV and use for JSON From: Joe Witt To: users@nifi.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ian Makes sense. Happy to help put together a template to see if we can get you closer. Working on some 050 release items at the moment but will flag this to come back Thanks Joe On Fri, Jan 29, 2016 at 8:43 AM, Hellstroem Christian (AE/PJ-ASC) wrote: > Hi, > > > > I=E2=80=99m just starting out with NiFi and I am ingesting a CSV file wit= h headers. > I would like to strip the header from each file and then use the header > (with column names) to map each row to JSON, after which more processing = is > done. Right now I=E2=80=99m stuck on which processors to use and how to d= o the > settings. > > > > The CSV files are pretty much as follows: > > > > SOME GENERIC INFO > > COL1,COL2,COL3 > > VAL11,VAL12,VAL13 > > VAL21,VAL22,VAL23 > > =E2=80=A6 > > > > Basically I want to remove the first line with =E2=80=98some generic info= =E2=80=99 that is > different for each file, and I want the columns from line 2 to become fie= lds > in JSON, so that I end up with > > > > { > > =E2=80=9CCOL1=E2=80=9D: =E2=80=9CVAL11=E2=80=9D, > > =E2=80=9CCOL2=E2=80=9D : =E2=80=9DVAL12=E2=80=9D, > > =E2=80=9CCOL3=E2=80=9D: =E2=80=9CVAL13=E2=80=9D > > } > > > > etc. > > > > I currently have a GetFile processor for the CSV file and an > AttributesToJSON afterwards with default settings, so there is no manual > mapping done anywhere. I checked out the CSV2JSON template by Hortonworks > but that=E2=80=99s a very manual process and that would be extremely tedi= ous as I > have files with roughly a hundred columns. > > > > I=E2=80=99m really stuck and any pointers would be greatly appreciated. > > > > Also a content preview feature would be really helpful=E2=80=A6 > > > > Cheers, > > > > Ian.