Loop through columns and join

Hi, I have a dataset with one table with ID’s and player names and one table with match statistics. The match table has a column with an ID for each player:

Home_player_1 Home_player_2 Home_player_3 etc. Always 11 players, the same for away players.

Is it possible to replace the ID’s in the match table with the names from the player table by writing a loop or something?

Thanks in advance!

submitted by /u/FruxNL
[link] [comments]


Go to Source of this post
Author Of this post: /u/FruxNL
Title Of post: Loop through columns and join
Author Link: {authorlink}