Forum Discussion
JoyriderBC
Jun 18, 2021Copper Contributor
Powershell is corrupting comma delimited files
My PowerShell script is adding double quotes and formatting the text incorrectly. I am removing lines that have a particular string. This line created by PowerShell script "RECTYPE,CNTBTCH,CNTITEM...
- Jun 28, 2021
JoyriderBC You can specify the encoding of the files with the -Encoding parameter.
For example:
Out-File c:\Exports\'Receiving Export SAGE Zeroes Gone.CSV' -Encoding utf8
diecknet
Jun 28, 2021Iron Contributor
JoyriderBC You can specify the encoding of the files with the -Encoding parameter.
For example:
Out-File c:\Exports\'Receiving Export SAGE Zeroes Gone.CSV' -Encoding utf8
JoyriderBC
Jul 05, 2021Copper Contributor
diecknet Thank you. Your suggestion fixed the two problems I was having. The updated script put a blank line as the first line in the output file. The input file does not have this blank line. The import into my program fails. How can the blank line be prevented?
Output file
Input file