Forum Discussion

Abhishek_117's avatar
Abhishek_117
New Contributor II
3 years ago

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

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

  • 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.

    • Abhishek_117's avatar
      Abhishek_117
      New Contributor II

      Hello  Aleksandar_A ,

      Thanks for the concern,but it is  not working.

       

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

      Regards,

      Abhishek Gupta. 

       

       

  • 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.

    Hope this helps!

    • Abhishek_117's avatar
      Abhishek_117
      New Contributor II

      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.

      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