Wondering if somebody can give me a clue on how to implement this,
I have two tables:
Table A: contains a single column as string
Table B: contains two columns (string both), “original” column has a value to look for and “replace” column has the correspondent value to replace.
The intention is to iterate over Table A and iterate also on Table B, if any of the strings in Table B “original” text is found in the row of Table A, then the text will be replaced by Table B “replace”.
Consider that in Table A, the record can contain more than one text that needs to be replaced, so for each row in Table A, the process needs to scan all Table B and replace the text if any is found.
Pseudo example: Table A
This is the first row
I am also a text here
This row is also a text
Table B:
Original Replace
row ROW
text TEXT
Outcome should be:
Table A
This is the firs ROW
I am also a TEXT here
This ROW is also a TEXT
Tried to implement with Recursive Nodes and nesting but couldn’t make it
Within the loop, the values of each row in Table B are passed along and used as variable in the String Manipulation node whereby the text replacement is arranged. At the end, only the last iteration is collected after all rows of Table B have been processed.
Hi @eamador@ArjenEX , it must be quite slow to go through each lookup one by one through that loop, and it will grow even slower as the number of lookups increases.
@eamador any reason why you want to do this using loops?
Here’s a more efficient way to do this kind of replace using the dictionary approach: