I’m a relative novice in PowerShell. As a result, sometimes there’s just a basic mechanic I’m missing or misunderstand that slows me down an awful lot. In this case, it feels like there’s something really basic with a foreach and maybe a hashtable (I don’t fully understand hashtables yet) that would solve this - but the answer has eluded me after a couple hours of using bing and experimenting. That said, I love learning PS - it’s been crazy helpful in my day to day tasks. Any help on this issue would be greatly appreciated!
I have a CSV I’ve imported into $s_file. It has a bunch of columns in it. The last 5 columns have numerical values.
I have another CSV file I’ve imported into $lookup_file. It has two columns: lookup_id and name.
I want to replace every instance of lookup_id in $s_file and replace it with name.
I’d prefer the result was exported into $r_file and that $s_file was unmodified (so I can go back to the source later if needed).
Thanks in advance.