12-21-2022 05:16 AM
Hi Team,
How can I remove all the blank rows from an input flat file? I cannot use a condition restricted on a single column as the other records are needed. All I want to do is filter out ALL ROWS that doesn’t have any data (like Row 4, 5, 7, 8 shown in the screenshot below)
Desired Output:
Thus, final output should be:
Thanking in advance.
Regards,
DT
Solved! Go to Solution.
12-21-2022 06:33 AM
This is maybe a little bit difficult, but you can put the following filter after your parser
The expression is: $.entries().filter(v => v[1] != "").length > 0
which will find any instance where all of the values for the given input document are all empty and filter them out.
01-03-2023 01:16 AM
Will JSON.stringify($) != “{}” works? I feel this is simpler.
01-03-2023 06:40 AM
@smudassir: I haven’t tried this but can surely give a try and keep you posted. Should the input stream be in any specific format?
BR,
Darsh
01-03-2023 08:22 AM
Just try on the data you had earlier.
01-03-2023 08:29 AM
Sure, will keep you posted after trying that solution. Thank you.