🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #10596

lf-2-crlf

#10596
From: RW Hendricks
Date: Thu, 21 Jan 1993 14:27
87 lines
4340 bytes
A few days ago I had a problem with lollipop on an IBM pc because the
(required) translation of lines ending in LF were not being translated to
CRLF.  I found a little trick using AWK - a single line program

$print >"filename.new"

which would do the conversion of an input file "filename.old". This
works because AWK (written by some of the folks who brought us C (and
Unix) knows  automatically what is required for the platform on which
it is operating and makes the conversion.

When I posted this solution, I got three interesting (and better)
solutions as listed below. Note that some of them also use the fact that
Unix systems seems to know how to do this automatically.

Thanks to everyone who responded.

Bob
=============================================================================
From: eijkhout@cs.utk.edu

Bob,

I think I have it figured out: when you move your files from
Unix to the PC you have to take care of line ends. Unix puts
only a LF at line ends, so the unpacked files have precisely that.
MsDos expects CR/LF, and the trouble from \comment comes from
\comment wanting one sort of line end (the native type) and
finding the foreign one.

Do you unpack on Unix, and copy with mcopy? In that case use
the -t option. If you untar etc on the PC I have no idea what
you should do, but several people have managed to get Lollipop
working on PC's so it should be possible.


Victor Eijkhout
=============================================================================
There is yet a better (well, easier) way to achieve this.  The -a switch in
the platform-independent version of UNZIP (5.0) supports the translation of
LF to CRLF and CRLF to LF (depending on platform).  Under DOS, the -a
switch converts LF to CRLF (where such a thing is expected); under other
systems, the -a switch converts CRLF to LF (where such a thing is
expected).  At your system-level prompt, type unzip for the menu of
switches available -- it's amazing how much flexibility is at your disposal
with this utility.

In general, the ZIP files at SHSU are created in LF format (as opposed to
CRLF) as this is the most commonly-employed format.  If supplied by an
author in ZIP format, the archive file is left per their submission (i.e.,
I generally don't mess with them further).

Regards,   George Greenwade
=============================================================================
From: Lance Tagliapietra <96720919@ucs.uwplatt.edu>
Subject: Re: Lollipop problem resolved!

If you have DOS 5 on your pc, the dos editor will read in files which have
LF ending all lines, and write back out the file in the standard DOS CRLF
line ending.

-Lance
 ---------------- Amiga - The Wild Side of Power Computing -----------------
 Lance Tagliapietra                       Internet: 96720919@ucs.uwplatt.edu
 P.O. Box 26                                BitNet: 96720919@uwplatt
 Platteville, WI 53818
=============================================================================
From: toin@stack.urc.tue.nl (Toin Bloo)
Message-Id: <9301201537.AA24636@blade.stack.urc.tue.nl>
To: LATEX@VTVM1.CC.VT.EDU


An other way to solve the LF/CRLF problem is to use an FTP program.
If you set the type to ASCII, the program will translate the EndOfLine
characters (on Unix only LF, on Dos both CRLF) in a proper way, depending
on the from and to machine.

So if you want to translate the LF's to CRLF's, put your file by FTP to a
Unix machine and get it back with the type set to Ascii. There you are!

--
Toin Bloo                                 The Young Scientists Eindhoven
+31 40 622681 (home)                      Frederiklaan 163  5616 NE  Eindhoven
toin@stack.urc.tue.nl                     The Netherlands, Europe
                                          (toin%storc@dutentb.et.tudelft.nl)
=============================================================================
Technical Details
Message-ID: <10235846@MVB.SAIC.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!howland.reston.ans.net!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!hri.com!spool.mu.edu!howland.reston.ans.net!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex
From: LATEX@VTVM1.CC.VT.EDU (RW Hendricks)
Newsgroups: comp.text.tex
Subject: lf-2-crlf
Message-ID: <10235846@MVB.SAIC.COM>
Date: 21 Jan 93 14:27:19 GMT
Organization: Info-Tex<==>Comp.Text.Tex Gateway
Lines: 87
X-Gateway-Source-Info: Mailing List