Question
Write /Prepare Fixed width length file in Nifi
I have an input JSON file and I want to convert it to a fixed-width length type file. If the length is less than the required length, trailing spaces should be added to the field.
Here is the sample Input JSON:
[
{
"orderId": "1234567890",
"orderName": "Test1"
},
{
"orderId": "12235",
"orderName": "Test2"
},
{
"orderId": "12236",
"orderName": "Test3"
}
]
Here is the desired Output:
1234567890 Test1
12235 Test2
12236 Test3
The condition here is if the length of orderId(in input JSON) is less than 10 then add the required spaces.
Can this be done in Nifi?
I want to have fixed-width length files.
Thanks in advance!

