cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to delete extra columns in csv file which have no data in it

Abhishek_117
New Contributor II

Hi,I want to delete the extra columns in CSV File which do not have data in it.While applying CSV Parser its showing that few extra columns are there.I want to delete those extra columns from CSV File.How to do that through help of Snap and Pipeline 

6 REPLIES 6

AleksandarAngel
Contributor III

Hello @Abhishek_117,

You can try by adding a Filter Snap after the CSV Parser with the following expression:

$ != {}

 Try this and let me know if this helps you.

Regards,

Aleksandar.

Hello  @AleksandarAngel ,

Thanks for the concern,but it is  not working.

Abhishek_117_1-1691046506887.pngAbhishek_117_2-1691046534421.png

 

Please let me know if any other way is there  that helps me to solve this problem.

Regards,

Abhishek Gupta. 

 

 

koryknick
Employee
Employee

@Abhishek_117 - I think the answer you're looking for is already an option in the CSV Parser snap.  In the "Header size error policy", select "Trim record to fit header".  This will ignore any extra columns in the input data.

koryknick_0-1691075224384.png

Hope this helps!

Hi @koryknick ,

Thanks For suggestion, but its working partially. Like I have added irrelevant columns in beginning and its adding data of relevant columns to irrelevant columns and due to which extra columns which are relevant they are becoming null.

Abhishek_117_0-1691154044937.png

Here Tik-Tok,Balance and Results are irrelevant column but when i select "Trim record to fit header" its taking data's  from right column i.e CustomerKey,Prefix etc to left columns(which are irrelevant).I want to delete those column