What have you tried so far?
You could treat your pipe delimited file as CSV and use Import-CSV and Export-CSV with some calculated properties to achieve what you need.
It is confusing when you say “copy each individual line of the file to multiple new lines in a new file while replacing the last value in the line.”
Does one line in the source file creaate multiple lines in a new file?
What determines the new value?
Or is this just a new file with a new last value for each line.
A simple -replace might be all you need depending on your ultimate goal.