Whats the diffrence of txt file between under win and linux?
ANd how can i convert them from one to the other???
Thank you.
Printable View
Whats the diffrence of txt file between under win and linux?
ANd how can i convert them from one to the other???
Thank you.
Windows ends each line with a CR-LF (0x0D 0x0A), while the civilized world just uses a LF (0x0A). Easiest way I know is to use VI on the file, and type
:%s/^V^M//
(that's "ctrl-V ctrl-M" -- the ctrl-M (0x0D) will actually show up because the ctrl-V puts VI in verbatim mode)
then do a :wq
There's probably a simpler filter using SED. Oh well. Works for me.
If you don't like the vim way, there are also:
dos2unix
and
unix2dos
from the command line. They're both very easy to use.