It is currently Tue, 07 Dec 2021 03:27:32 GMT



 
Author Message
 How to convert LF to CR/LF ?

recode lat1:ibmpc
will do (perhaps there's an alias called unix2dos for it also)
--
     ********************************************************
     *  If there is to be a brave new world, our generation *
     *  is going to have the hardest time living in it      *
     ********************************************************
         Christoph Gr?ver   gro...@uni-muenster.de



 Sat, 09 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

On Tue, 22 Apr 1997 11:14:21 -0700, "Robert Augustyn"

I have heard of the utilities dos2unix, unix2dos, don't know where
they lurk. I use tkedit, since I am an avid Tcl/Tk fan, which also
includes the ability ti convert to/from MacOS CR, or I use sed, the
Stream Editor, as a filter.

Harry



 Sat, 09 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

Hi,
Is there an utility to do that ?
I am expection it to be but do not know where to look for it
Thanks in advance
robert



 Sat, 09 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

Do you have perl? Try this:

#!/usr/bin/perl -w

while (<STDIN>) {

    chomp;
    print "$_\r\n";

Create this script. Name it dos2unix. Make it executable. Walla! To run
it type "cat myfile | dos2unix > mynewfile"

If you don't have perl and your desperate here is kludge solution: ftp
the file to yourself in ascii format (assumes you have a network with
dos clients).

--
Charles Ritter

Microsoft NT - when they are finally finished it will be the best
documented unix operating system on the market.



 Sat, 09 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

Charles F. Ritter (crit...@quack.kfu.com) wrote:
: >
: > Hi,
: > Is there an utility to do that ?
: > I am expection it to be but do not know where to look for it
: > Thanks in advance
: > robert

: Do you have perl? Try this:

: #!/usr/bin/perl -w

: while (<STDIN>) {

:     chomp;
:     print "$_\r\n";
: }

: Create this script. Name it dos2unix. Make it executable. Walla! To run
: it type "cat myfile | dos2unix > mynewfile"

Hi,
        Here is the dos2unix Bourne shell one. All it does is change
the code for the <CR>.

#!/bin/sh
cat ${1} | tr '\015' '\012'

        Make the script file as described above in dos2unix. To do
unix2dos do:

#!/bin/sh
cat ${1} | tr '\012' '\015'

--
        Mike,
        mik...@whiterose.net



 Sun, 10 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

There are two other ways as well.  There are a pair of binaries
available called, oddly enough, "dos2unix" and "unix2dos".  Another way
is if you have the "mtools" set.  Its "mcopy" command has the "-t"
option which performs this operation as well.
--
F. Michael Orr
Sr. Systems Engineer
Norfolk Public Schools, Norfolk, VA
"Go Miami Dolphins!"



 Sun, 10 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

On Tue, 22 Apr 1997 19:06:22 -0700, Charles F. Ritter <crit...@quack.kfu.com> wrote:

Or better yet, avoid being a nominee for this month's Unnecessary Use
of 'cat' Award and do it this way ...

   #!/usr/bin/perl -w

   while (<>) {
      chomp;
      print "$_\r\n";
   }

After renaming it 'dos2unix' you would run it like this ...

   dos2unix myfile >mynewfile

The nice thing about Perl's  <>  operator is that if you really
want to go for the award by piping the output of 'cat' into this
version of the 'dos2unix' script, you can still do so.

--
 Lloyd Zusman
 l...@asfast.com



 Wed, 13 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

On 26 Apr 1997, Lloyd Zusman wrote:

Unix's extensibility in programming, also has allowed for programs
to be created more than once.  For every script there is probably
a pipe line that does the same job.

Try:
tr '\r' -d < dostext.txt > unix-long-file-name.text
and
tr '\r' '\n' < macintosh-longname.text > unix-longer-file-name.text

You know people say that Unix is better for programming.  But you see
there really is less programming involved.  To do the evivalent of
writing data to a raw floppy (no file system) it is programming
project in MSDOS.  But in Linux it's just a cat redirected to a special
file.

yours,
  Shawn Pringle



 Sat, 16 Oct 1999 03:00:00 GMT   
 How to convert LF to CR/LF ?

On 1997-04-23 mik...@whiterose.net said:
   >Path: triglav.iwaynet.net!odin.oar.net!mercury.oar.net!malgudi.oar.
   >net!news.iac.net!stdio!uninett.no!news-feed.inet.tele.dk!cpk-
   >Newsgroups: comp.os.linux.misc
   >Date: 23 Apr 1997 16:55:34 GMT
   >Organization: DataHaven Project, Inc (http://www.dhp.com)
   >Lines: 41
   >References: <5jik94$ou...@mail.pl.unisys.com> <335D6E9E.
   >3AB9E...@quack.kfu.com>
   >NNTP-Posting-Host: whiterose.net
   >X-Newsreader: TIN [version 1.2 PL2+color]
   >Xref: triglav.iwaynet.net comp.os.linux.misc:164938
   >Charles F. Ritter (crit...@quack.kfu.com) wrote:
   >Hi,
   >Here is the dos2unix Bourne shell one. All it does is change
   >the code for the <CR>.
   >#!/bin/sh
   >cat ${1} | tr '\015' '\012'

That would create a blank line between each line.You'd have double LFs.
Try this instead.
tr -d \\r

   >Make the script file as described above in dos2unix. To do
   >unix2dos do:
   >#!/bin/sh
   >cat ${1} | tr '\012' '\015'

That would create a Apple file,not IBM.
(no LFs)

Net-Tamer V 1.08 - Test Drive



 Wed, 20 Oct 1999 03:00:00 GMT   
 
   [ 9 post ] 

Similar Threads

1. lpr did not convert LF->CR/LF

2. How to convert LF to CR LF for transmission to PC

3. How to convert LF to CR LF for transmission to PC

4. utility to convert between cr/lf and lf end of line

5. Convert LF to CR & LF

6. Converting LF to CR-LF on remote printers under SYSV

7. Enabliing "LF->CR/LF".

8. Solaris 2.51 printing via NT lpdsvc, LF->CR/LF conversion

9. enabling 'LF->CR/LF'


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software