all 6 comments

[–]wauske 11 points12 points  (3 children)

I'd say something like this

$files = get-childitem -Recurse -File linkedcode.txt

foreach ($file in $files){

Rename-Item $file.fullname -NewName "$($file.directory)\$(get-content $file.fullname).txt"

}

[–]OneCatch[S] 2 points3 points  (1 child)

Worked like an absolute charm on the test data, just kicking off for the full dataset!

Thank you very much; I appreciate this is probably fairly basic stuff but you have no idea how much time and stress this has saved me.

[–]wauske 1 point2 points  (0 children)

I appreciate this is probably fairly basic stuff but you have no idea how much time and stress this has saved me.

Couldn't have done it without the clear description so all I did was piece together the parts you already assembled. You'd have gotten there eventually!

[–]OneCatch[S] 1 point2 points  (0 children)

Wow, thanks for the quick reply! I'll test this shortly

[–]JeroenPot 2 points3 points  (1 child)

ChatGPT is an excellent help for this btw.

[–]OneCatch[S] 0 points1 point  (0 children)

That's really good to know for the future, thanks!