Subject: Text file transfer between linux and dos

From: Yubo Fan <[email-masked]>
Date: Tue, 29 Feb 2000 15:05:57 +0800

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"
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
=============================================================

---

From: Robert Krawczyk <[email-masked]>
Date: Tue, 29 Feb 2000 17:24:04 +0100 (CET)

> 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

> -= 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]
> 
> 
> 
> 
> 

-----------------------------------------------
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]
-----------------------------------------------

---

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

--

  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]

---

From: "Martin L. Sage" <[email-masked]>
Date: Tue, 29 Feb 2000 12:38:52 -0500

Run the program dos2unix on each file.  If you do not have that program
do the following:
   tr -d \\015 < 'file name' > 'new file name'

where 'file name' is the name of the file you have in the mounted DOS
partition including path and 'new file name' is the name of the file
including path where you want the file to reside for use in Linux.  If
you want it to stay where it was and keep the same name you must change
the name in the 'tr' operation and use 'mv' to change it back to the
original name.

---

From: Nestor Cubillan <[email-masked]>
Date: Mon, 28 Feb 2000 02:03:38 -0400 (VET)

> was added to the end of each lines.

 this is a diference between text format. this problem is solve with a perl
script. there is a script called d2u-u2d:
http://www.ftls.org/en/examples/perl-tools/d2u-u2d.shtml

 They cannot work by G98.
> I need some help. Is there a way to copy the files by ascii way (not

i edit my file with vi editor.

best regards