Question

I am using Gedit and I save my script outputs as .txt so I could open it on Windows using Notepad but the problem is that Gedit does not use the same line termination as Notepad in Windows. I tried doing this:

sudo apt-get install dos2unix

but it does not yield any effect on my text files. I also cannot do the process where you save the file with the Windows option for the Line Ending because the text files are auto generated.

I hope you guys can help me. Thank you so much!

Additional detail: I have installed Notepad++ using WINE but I cannot make Notepad++ as the default program because it is installed using WINE.

Was it helpful?

Solution 2

You need to install unix2dos :

sudo apt-get install unix2dos

And then convert your saved files in linux:

unix2dos text.txt

OTHER TIPS

You need to execute dos2unix, not just install it. try this...

unix2dos unixinput.txt winoutput.txt

and here is the awk way...

awk 'sub("$", "\r")' unixinput.txt > winoutput.txt

I used to use fromdos / todos commands .. http://manpages.ubuntu.com/manpages/lucid/man1/fromdos.1.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top