[wplug] CRLF

Brandon Kuczenski brandon at 301south.net
Mon Feb 9 20:36:11 EST 2004


> > : > Is there any way to use the standard *nix tools to convert the CRs (or LFs
> > : > - I forget which is which) in an ascii document to CR/LF for windows text
> > : > editors?
> > : >
> > : > -Brandon
> > :
> > : try:
> > :
> > :   dos2unix
> > : and
> > :   unix2dos
> >
> > In the event that these do not exist, use Perl.
> >
> >   perl -pi -e's!$|\r!' filename.txt
> >
> 
> Also consider how you are getting the files from *nix to Micro$oft, FTP
> in BINARY will cause this type of problem while FTP in ASCII will not.
> 

Well, in one case it's AFS, and in the other it's as an email attachment. 
(PINE -> some windrone software).

unix2dos2unix looks just right; but the perl looks far more interesting.

-Brandon
Following is a humorous anecdote about M$ File formats.  It will likely
contribute little positive to the substance of the online discussion, and
so was placed as a post-script out of courtesy to staying on-topic.  
Read/reply at your own risk.

As a first-year grad student, I am required to attend departmental
seminars and submit brief reports about them.  The first such report I
wrote in emacs and emailed away, but the recipient asked for me to please
send it as a Word document.  She didn't mention that she couldn't read the
file, but I now realize that it must have been the CRLF debacle.  I made
the report into a webpage, posted it, and sent her the URL, along with a
brief (though pointed) critique of Microsoft docment formats as not
universally readable and expensive (both in terms of money and
'information per character') and the comparative beauty, simplicity and 
universality of plain text.  I pointed out how the same document that
took up about 2500 bytes as text, took 32 kb simply by copying and pasting
it into a Word document, and saving that.  Multiplying that by 60, the
number of new graduate students submitting reports, adds up to
considerable bandwidth, to say nothing of the fact that if Linux continues
its upward trend, then MS data formats won't even be readable 15 years
from now. [Slight exaggeration, perhaps.]

Around the time the third report was due, we received an email saying that 
the submission of seminar reports online was overfilling the recipient's 
inbox; new departmental policy was that the reports would not be accepted 
electronically, but would have to be printed and submitted by hand.

Here's to progress.





More information about the wplug mailing list