Subject: Re: CCL:Text file transfer between linux and dos

From: Mark Forster <[email-masked]>
Date: Tue, 29 Feb 2000 17:28:32 +0000

Dear CCL

Here is a short perl script (crlf.pl) that will fix this problem
for you. The usage is:

    crlf.pl dosfile.txt > unixfile.txt

Hope this helps

Mark F

----quote---
#!/usr/local/bin/perl

while (<>) {

        $a=$_;
        $a =~ s/[\012]//;
        $a =~ s/[\015]//;
        print "$a\n";

}
---unquote---

Robert Krawczyk wrote:

> On Tue, 29 Feb 2000, Yubo Fan wrote:
>
> > Hi,
> >
> > I have installed Windows 98 and RedHat Linux 6.1 on my PC. Usually I
> > edit G98 input file on Windows 98. The problem is when I start Linux and
> > mount the DOS partitions, I cannot copy the input files correctly. "^M"
>
> This is due to the different line end. On MS-DOS the line ands with a
> CR/LF-Pair, UNIX uses LF. You will need the freely available utilities
> dos2unix or you can use (X)Emacs to convert the line ends (query replace).
>
> Hope that helps...
>
> Robert
>
> > was added to the end of each lines. They cannot work by G98.
> >
> > I need some help. Is there a way to copy the files by ascii way (not
> > binary way).
> >
> > Thanks in advance
> >
> > Y. Fan
> >
> > --
> > =============================================================
> > Yubo Fan                         Email: [email-masked]
> > Organic Synthesis Lab
> > The Department of Chemistry
> > Fudan University                 Phone: 8621-65648139
> > No. 220 Handan Road              Fax:   8621-65641740
> > Shanghai, 200433
> > P. R. China
> > =============================================================
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> -----------------------------------------------
> Robert P. Krawczyk
> Lehrstuhl fuer Theoretische Chemie
> TU Muenchen
> Lichtenbergstr. 4
> 85747 Garching
>
> Tel.: +49 89 289 - 13618
> Fax.: +49 89 289 - 13622
> e-mail: [email-masked]
> -----------------------------------------------
>
> -= This is automatically added to each message by mailing script =-
> [email-masked] -- To Everybody    |   [email-masked] -- To Admins
> [email-masked] -- HELP CHEMISTRY or HELP SEARCH
> [email-masked] -- archive search    |    Gopher: gopher.ccl.net 70
> Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan: [email-masked]

--

  Dr Mark J Forster Ph.D.
  Principal Scientist
  Informatics Laboratory
  National Institute for Biological Standards and Control
  Blanche Lane, South Mimms,
  Hertfordshire EN6 3QG, United Kingdom.

  Tel  +44 (0)1707 654753
  FAX  +44 (0)1707 646730
  E-mail  [email-masked]