Hi all,
Is there a way to rename columns or add a prefix of the filename to the column?
I am doing a join and would like a better way to identify where the column comes from other then "left" or right".
ie I'd like to rename, [File1]_Person or [File2]_Person
Any help would be appreciated.
Solved! Go to Solution.
Hi @wonka1234 you can via option in the join configuration or you enter the value you want in the Rename column. However you wouldnt be able to dynamically add the filename within the Join tool. You could however build out some logic using the dynamic rename tool though.
How can I make this dynamic to pickup the file name used?
Hi @wonka1234
You can also use the Dynamic Rename tool.
Using this tool, you can add Prefix/Suffix to the field names.
If you put into Dynamic Rename tool before join tool, it will work well.
Hi @wonka1234
Like @AkimasaKajitani said, dynamic rename will be your friend.
If you read in the file name as a field, you can dynamically fetch it and use it like below. The standard functionality makes you hardcode a prefix, so this will be dynamic if your files change.
I made other solution, but similar to @Luke_C 's solution.
We can get the file path from "Source" field by Field Info tool.
I use this information. So my solution is as follows.
Hi @wonka1234 I came up with an approach which will rename all the fields after the join with the file name. Let me know what you think?
@Luke_C Hi Luke, how did you get file name in your "input" file though? I do not have this.
cant open! wrong version :(