Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   text file from Linux to windows. (http://www.linux-archive.org/debian-user/97841-text-file-linux-windows.html)

Miles Fidelman 05-30-2008 01:28 AM

text file from Linux to windows.
 
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


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

al davis 05-30-2008 02:17 AM

text file from Linux to windows.
 
On Thursday 29 May 2008, Miles Fidelman wrote:
> 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? :-)

One reason for that was that it took extra time to do a carriage
return. Having a non-printing character required after a CR
made sure that the carriage had returned before printing
another character.

Remember .. those things had no buffer. The character decoding
was completely mechanical. The electrical feed consisted of
a "current loop" that operated an electromagnet in sync with
the serial code.



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

"Christofer C. Bell" 05-30-2008 03:25 AM

text file from Linux to windows.
 
On Thu, May 29, 2008 at 7:26 PM, L. V. Gandhi <lvgandhi@gmail.com> 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?

If you find that the file is already on a Windows system, and you'd
like to convert it in the absence of Debian tools, you'll find that
MS-DOS Edit reads Unix formatted text files correctly. You can do the
"conversion" by opening the file in Edit and then saving it out again
(you will need to make a change to the file in order to save it, say,
adding a space and then deleting it). When you save out the file,
Edit will append a CRLF to the end of each line as Windows text
tools expect (while will cause the file to open correctly in Notepad).

It's not a satisfying solution, but it will allow you to convert those
files you come across on Windows systems that are having the issue you
describe (which is common).

--
Chris


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

Ron Johnson 05-30-2008 03:37 AM

text file from Linux to windows.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/08 20:28, 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).

While I'm too young to have used an ASR33, I'm old enough to have
used typewriters, and fart with dot matrix printers by sending only
^M after the line, and watching lines print over each other.

So shame on me.

> (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.

And the pre-OSX Macs used ^M as line separator.

Regarding a mess-up, I disagree. When looking for EOL, it's far
easier to scan for a single byte than for a ^M^J pair. Unix, having
print spools and drivers, was (since there are so few text-only
printers anymore) easily able to notice a
in the data stream and
replace it with a ^M^J.

> 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

- --
Ron Johnson, Jr.
Jefferson LA USA

"I must acknowledge, once and for all, that the purpose of
diplomacy is to prolong a crisis.", Mr. Spock
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIP3aJS9HxQb37XmcRAtVEAKChhfptne0v2txbHD40/FejDNKUSQCePDU3
7FDYrvai+r22TtDa8ZqtMII=
=KAkQ
-----END PGP SIGNATURE-----


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

"Russell L. Harris" 05-30-2008 05:35 AM

text file from Linux to windows.
 
* Miles Fidelman <mfidelman@meetinghouse.net> [080529 23:28]:
...
> 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? :-)

Back about 1967, the ASR33 was coveted by those of us whose only means
of input and output was the 80-column punch card.

"Output?", you say? Yes. For printed output, you put the deck of
output cards into the card hopper of the line printer -- the chassis
of which was a cube about four feet on a side. But inasmuch as the
printer broke down on a daily basis, you quickly learned to read the
holes in the cards.

I speak of the days of Fortran-II running on an IBM 1620. Back then,
it often was necessary to load the compiler (another deck of punched
cards) before loading the application.

RLH


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

"Adrian Levi" 05-30-2008 08:54 AM

text file from Linux to windows.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

2008/5/30 Russell L. Harris :
> I speak of the days of Fortran-II running on an IBM 1620. Back then,
> it often was necessary to load the compiler (another deck of punched
> cards) before loading the application.

It must have been fun to watch someone play pickup 500 and put them
all back in order again.

Adrian

- --
24x7x365 != 24x7x52 Stupid or bad maths?
hm. I've lost a machine.. literally _lost_. it responds to ping, it
works completely, I just can't figure out where in my apartment it is.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: http://getfiregpg.org

iQEVAwUBSD/ArqTxsRnrwUbcAQIIgAf/RnDUu2ufiVT0NY/H5MQeSZ4jwzBEQUk9
lzumMJ2BSuwRpv8BBbp2Migp56TPnS6u/Sc1B5I/Zyjb2dOLmHYg441T90cDbckS
URLxFtlQF7krP5jUd6DIjWT0blKq1NRv0rRSvOygpn8oyYyH7a T6ZEg4j1fBlRx2
dN7W93NnfJubDDshrFq2/JVUZgeRwiayzZNGA0CpVh5LyjRNnELsVJOFCEujiXA5
esWK+8Y37W6ihWPYWe0+lkFV2gvoN8TFl+nMqv6mtI2Hscd1gN Y2QNMusrxvsyEV
li7IrzWs+h7DDOnT+A/SlwZB0sdjh+FQ6nQs/z7Xo2MkWgu81TlBZg==
=eoJ+
-----END PGP SIGNATURE-----


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

Rominiek Schoonen 05-30-2008 09:40 AM

text file from Linux to windows.
 
# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format
sed "s/$/`echo -e
`/" # command line under ksh
sed 's/$'"/`echo
`/" # command line under bash
sed "s/$/`echo
`/" # command line under zsh
sed 's/$/
/' # 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@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

"Russell L. Harris" 05-30-2008 10:16 AM

text file from Linux to windows.
 
* Adrian Levi <adrian.levi@gmail.com> [080530 03:56]:
> 2008/5/30 Russell L. Harris :
> > I speak of the days of Fortran-II running on an IBM 1620. Back then,
> > it often was necessary to load the compiler (another deck of punched
> > cards) before loading the application.
>
> It must have been fun to watch someone play pickup 500 and put them
> all back in order again.

Back then, many a student made himself a personal copy of the compiler
(a stack of punch cards about twelve inches high) and carried it along
each time he went to to the computing center, rather than risk using
the "public" copy of the compiler which was kept at the computing
center. I may still have my copy.

RLH


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

John Hasler 05-30-2008 01:05 PM

text file from Linux to windows.
 
Adrian writes:
> It must have been fun to watch someone play pickup 500 and put them all
> back in order again.

That's what the card sorter was for.
--
John Hasler


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

Marc Shapiro 05-30-2008 02:14 PM

text file from Linux to windows.
 
Adrian Levi wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

2008/5/30 Russell L. Harris :


I speak of the days of Fortran-II running on an IBM 1620. Back then,
it often was necessary to load the compiler (another deck of punched
cards) before loading the application.



It must have been fun to watch someone play pickup 500 and put them
all back in order again.


Been there. Done that. Didn't get a T-shirt.

My final project for my Fortran class was a deck of about 750 cards by
the time I finished. It did get dropped at least once and was probably
about 500+ cards at the time. This was a bit later, in time -- mid 70's
using Fortran IV and Fortran-G on an IBM 360.


--
Marc Shapiro
mshapiro_42@yahoo.com




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


All times are GMT. The time now is 06:55 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.