Skip to content

Convert Files from Linux/Unix Format to Windows and Vice Versa

cpx April 6, 2014 1 min read shell

With AWK:



awk '{ sub("\r$", ""); print }' windows.txt > unix.txt
awk 'sub("$", "\r")' unix.txt > windows.txt

With TR

tr -d '\15\32' < winfile.txt > unixfile.txt

 

:1,$s/^M//g

 

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x