cancel
Showing results for 
Search instead for 
Did you mean: 

Replace values from one file in another file

sshilpam
New Contributor

Hi Team,
We are new to snaplogic and have started building pipelines. There are few cases where we are having challenges.

I have two csv files.

image

image

Image 1: The first column has the column names which are present in the file shown in Image 2.

Question: I need to search for the Source Value in the file in image 2 and replace with Target value.
This replacing should happen only in the Column name mentioned in the first column of file 1

Appreciate your help.

Also can you let us know if using Expression language is better or the Snaplogic Snaps for any given task ?

3 REPLIES 3

skatpally
Former Employee

You can do use a JOIN Snap and get the desired o/p.

There is no hard and fast rule on when to use an Expression Language or Snap. It will mostly depend on your ease of writing an Expression.

Rajath
New Contributor

@skatpally @sshilpam
We tried using the join snap and it worked too. But the issue with the join snap is that we’re unable to use multiple columns at once. It works only if we’re considering only single column. Please let us know if there is a miss from our side or is there an alternate solution.
Thanks

skatpally
Former Employee

Sorry, I thought you are just looking at 1 field. The way to do this would be using an Expression Library.
All the static value from the first csv can go into an .expr config file and in the pipeline you can refer it.

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438110/Expression+Libraries