Re: text file from Linux to windows.



# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
sed "s/$/`echo -e \\\r`/" # command line under ksh
sed 's/$'"/`echo \\\r`/" # command line under bash
sed "s/$/`echo \\\r`/" # command line under zsh
sed 's/$/\r/' # gsed 3.02.80

Hope this helps!





On [DATE], "[NAME]" <[ADDRESS]> wrote:

Miles Fidelman wrote:
Ron Johnson wrote:
On 05/29/08 19:35, Paul Johnson wrote:

On Thursday 29 May 2008 05:26:43 pm L.V.Gandhi wrote:

I have made a text file in Linux using echo and cat commands. When I
open the file in note pad, I find files are not having line break, but
having a character in place of line break. Is there any way in echo
and cat commands usage to put windows line break?

Windows happens to end lines in a way that's gratuitously different
from the rest of the world. Check out the tofrodos package.


Since 90% of all computers are DOS/Windows, and got that method from
CP/M, which did it that way back in 1976/77, your "gratuitously
different" comment is absurdly wrong.

Actually, it dates back further than that, to ASR33 teletype machines,
where you needed to issue separate carriage return and line feed
characters to end a line - to i) physically return the carriage to the
beginning of the line, and ii) feed a line of paper (turn the
platten). (Anybody else out there old enough to remember when ASR33s
where THE standard i/o device? :-)

CR+LF is also required in most Internet protocols.
This is one of the surprising areas, where the Microsoft products get
things right, and the Unix world messes up.

There are some good historical references at:

http://en.wikipedia.org/wiki/Newline
http://www.rfc-editor.org/EOLstory.txt
http://www.w3.org/TR/newline

Miles Fidelman


maybe someone allready answerd but ...
unix default line brake is ASCII 10 and windows is 13.

You can use unix2dos or tofrodos to change it.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: What is the more popular UNIX flavor?
    ... about my experience with Solaris and Cygwin. ... installing packages. ... needing eg tftp you only need to activate on a Unix system. ... probably need installing first on the equivalent Windows system. ...
    (comp.unix.questions)
  • Re: Five Architectural Flaws in Windows Solved In Mac OS X
    ... But it is still an improvement over Unix, wherein *any executable* can be highly privileged and interact with the user. ... The usual security precautions prevent unauthorized people from doing this, but that's true on Windows also. ... I just got thru upgrading the wifes Mac to Tiger and hpfs is the default. ... This is a more advanced design that Unixes have been trying to duplicate by adding thread support. ...
    (comp.sys.mac.advocacy)
  • Re: Linux no threat to Microsoft
    ... originally developed for Unix. ... Windows has't come on any of the machines I've ever purchased. ... Yet over those years Linux Market Share on the desktop has actually ... philosophy of Apple - later adopted by Microsoft. ...
    (comp.os.linux.setup)
  • Re: OS X "Security" myths
    ... >> lot of UNIX systems down to their knees. ... >>> their code, so they concentrate on developing exploits for Windows, ... > It does tell me that there is not much "boast factor" for malware ... Just like the Hackers convention in Las Vegas known as ...
    (comp.sys.mac.advocacy)
  • Re: Wozu Linux privat einsetzen?
    ... > Open Source bzw. GNU sind nicht an eine bestimmte Plattform gebunden. ... Windows ist nun mal nicht OpenSource. ... > Unix ist genauso gewachsen wie DOS, OS/2, Windows. ...
    (de.comp.os.unix.linux.misc)