Member since
09-02-2018
1
Post
0
Kudos Received
0
Solutions
09-04-2018
03:25 PM
I am new to nifi. I would like to parse a fixed width file. The format of file will be something like below.
There can be four record types.
First 3 digits will indicate the record type.
100 - File header
101 - Detail record
102 - Summary record
103 - File trailer Sample content of File :
100 101John Doe0 001 N Front St, Pittsburgh, PA-12345 Engineer 111 W Encanto Blvd, Pitssburgh, PA-54321
101John Doe1 002 N Front St, Pittsburgh, PA-12345 Engineer 222 W Encanto Blvd, Pitssburgh, PA-54321
101John Doe2 003 N Front St, Pittsburgh, PA-12345 Engineer 333 W Encanto Blvd, Pitssburgh, PA-54321
101John Doe3 004 N Front St, Pittsburgh, PA-12345 Engineer 444 W Encanto Blvd, Pitssburgh, PA-54321
102Pittsburgh 4 200 101Chris Doe0 111 N Front St, Pittsburgh, PA-12345 Engineer 111 W Encanto Blvd, Pitssburgh, PA-54321
101Chris Doe1 222 N Front St, Pittsburgh, PA-12345 Engineer 222 W Encanto Blvd, Pitssburgh, PA-54321
102Pittsburgh 2 200 103 6 600 Format of Detail record Column 4 to 17 - Name Column 18 to 60 - Home Address Column 61 to 79 - Role Column 80 to 128 - Work Address How do I identify record type ? How do I perform substring logic on the above using "ReplaceText" processor or any other processors ? I would like to convert this to json format.
... View more
Labels:
- Labels:
-
Apache NiFi