Discussion:
Convert text file from DOS to Unix format using Powershell
(too old to reply)
curiousForEx
2009-06-16 03:47:38 UTC
Permalink
Hi,
Iam currently converting an excel sheet to csv format in powershell.
But the csv file gets saved in DOS format with CR-LF format whereas I
need to save it as Unix LF format. Is there any wayin Powershell that
I can convert the output csv file to UNIX fomat?

Thanks!
Matthias Tacke
2009-06-16 10:10:19 UTC
Permalink
Post by curiousForEx
Hi,
Iam currently converting an excel sheet to csv format in powershell.
But the csv file gets saved in DOS format with CR-LF format whereas I
need to save it as Unix LF format. Is there any wayin Powershell that
I can convert the output csv file to UNIX fomat?
You could write your own function
<http://www.thomas-krenn.com/de/wiki/Dos2unix_und_unix2dos_in_der_PowerShell>

Or use powershell community extension cmdlets
<http://pscx.codeplex.com/Wiki/View.aspx?title=PSCX%201.1.1%20Features>
ConvertTo-UnixLineEnding
ConvertTo-WindowsLineEnding

Regards
Matthias

Loading...