$customHeader
Skip to end of banner
Go to start of banner

Example 1: Remove columns from Excel files using Mapper

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This example pipeline demonstrates how to read an Excel file from the SLDB and remove columns that you do not need from the file.

Configure the File Reader Snap to read the Excel file from which you want to remove specific columns.

Parse the file using the Excel Parser Snap. You can preview the parsed data by clicking the (blue star)  icon.

You can view the columns you want to remove from the preview file. To remove the Discounts and Month Number columns add a Mapper Snap to the pipeline.

In the Expression field, you enter the criteria (as shown below) that you want to use to remove the Discounts and Month Name columns. 

$.filter((value, key) => !key.match("Discounts|Month Number"))

Enter $ in the Target field to indicate that you want to leave the other column names unchanged. Validate the Snap. You can view that the Discounts and Month Name columns are removed.

To write the updated data into the SLDB as a JSON file, add a JSON Formatter Snap to the pipeline to convert the documents from the Mapper Snap into binary data.

Then, add a File Writer Snap and configure it to write the input streaming data to the SLDB.

You can now view the saved file in the destination project in SnapLogic® Manager.

Download this pipeline

  • No labels