I have created a Powershell script that lists files in a folder to a file.
The script then manipulates the file to create a SQL script. The file then looks something like this:
SELECT field1, field2, field3 FROM Invoices WHERE DocNum IN (
123456,
123457,
123458,
123459,
I would like to change the last comma to a closing bracket. What is the best approach?
Thanks
Carrot
I have tried variations on the scripts in /questions/57522396/how-to-replace-a-character-at-the-end-of-a-string-file and others
But the last record is not being updated
New contributor
CarrotIFS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.