Hey guys, TOS is amazing. However I'm having a problem combining 2 columns into 1. I've looked into using tMap, but I can't find my solution. I'm inputing from a delimited file if that makes any difference. I have 2 columns: My input is ID | Category1 | Category2 | 1 | Apparel | Jackets | | 2 | Shoes | Running | My output that I want to have is ID | Category | 1 | Apparel | | 2 | Jackets | | 3 | Shoes | | 4 | Running |
This is a good exercise to get familiar with the flexibility of Talend. In order to achieve this you will need a tMap and a tNormalize component. In the tMap you need to join the Category1 and Category2 columns with a consistent separator. So in your output, you will want something like.....
row1.Category1 ";" row1.Category2
Then join the tMap output to the tNormalize component. The configuration of this component is pretty well explained here. If you want to update the ID with a continuous sequence of 1 to n, then you can do that with several different components. An easy way is to use another tMap and use a tMap variable to count the rows. Use that counter in your output.