Let's say i have a text file (file.txt) with this in it: something.ab-cdefgh-jk-lmno-1.pqr-stuv-a.z.something-xy.somethingelse
I want to overwrite the file to look like this instead: something.ab-cdefgh-jk-lmno-1
I've tried a few things with split but I'm a powershell noob and I don't think I'm doing it right. I've tried to follow along with this stackoverflow but I can't seem to understand how to apply it to my question. As always, any help is greatly appreciated.
A little more info: In my script I hit an API to generate a file with a string. The API doesn't provide a way to split the result or alter it. The file I end up with is a single string with a bunch of stuff I don't want. I just want the stuff before the second period.