Re: Problems with text file going from Linux to MS Windows
On Sun, Sep 02, 2007 at 03:31:53PM +0200, Matus UHLAR - fantomas wrote:
> On 21.07.07 10:46, Rodolfo Medina wrote:
> > If I want to send a text file to an MS Windows user there are problems: in
> > fact, in MS Windows a text file which has been composed under Linux is not
> > correctly read: the line ends are not recognised.
> how do you transfer those files? FTP has ASCII transfer which translates
> line ends correctly and mail has also well-defined line ends, so all mail
> clients know how to convert.
> It can be a problem when you edit the same file on the same disk using
> different editors, but meny editors support both line ends...
> > The remedy is to cut the text and paste it into an MS Word file, then cut
> > it again and re-paste it into the text file, which is not so good because
> > this way I need rebooting every time into the Windows partition.
> poor and dirty workadound, Whatever but word...
Yes, a simple file containing
perl -pi -e 's/\n/\r\n/g' $1
and made executable should do it. Or the same from the command line,
putting the filename in place of $1.