How to save Unix File to Dos/ASCII format?

How to save Unix File to Dos/ASCII format?

Post by Stephan Schoombi » Mon, 19 May 1997 04:00:00



Hi

I am not a Unix expert and therefore this question may sound silly.
I need to get a file from a database-application called Notebook, the
application is on a network running on Unix. I need to copy this file
from the server into DOS format or ASCII raw text/data. How do I go
about it?

Thanks in advance
Stephan Schoombie

 
 
 

How to save Unix File to Dos/ASCII format?

Post by Tad McClell » Mon, 19 May 1997 04:00:00


: Hi
:  
: I am not a Unix expert and therefore this question may sound silly.
: I need to get a file from a database-application called Notebook, the
: application is on a network running on Unix. I need to copy this file
: from the server into DOS format or ASCII raw text/data. How do I go
: about it?

I assume the file on Unix is a text file. Unix uses the single
character 'newline' (ASCII 10 decimal, called linefeed) to mark
line ends. The scourge from the Evil Empire uses two characters
to mark line ends, 'carriage return' (ASCII 13 decimal) and 'linefeed'.

The easiest way to get the line endings converted is to use 'ftp'
in ASCII mode. ftp will convert them for you.

Some systems have a unix2dos command to do this.

Or, you can roll your own using a general purpose programming language.

It is extremely simple to do this using a Perl one-liner:

perl -p -e 's/\n/\r\n/' unix_format_file >silly_format_file

: Thanks in advance

Hope this helps!

--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming


 
 
 

How to save Unix File to Dos/ASCII format?

Post by Mukul.Kuma » Tue, 20 May 1997 04:00:00


You need to do four things :
i)      append '^M' (a single character at the end of each line),
        this is make DOS think that the line ends at this point,
ii)     for DOS file sharing usually the mandatory locking bit
        for the file needs to be set , so do a chmod +l <file_name>,
iii)    append an appropriate suffix, like .txt,
iv)     make the file name all small-letters, DOS doesn't (usually
        understand) capital letter'ed file names.
Thanks,
 Mukul.


> Hi

> I am not a Unix expert and therefore this question may sound silly.
> I need to get a file from a database-application called Notebook, the
> application is on a network running on Unix. I need to copy this file
> from the server into DOS format or ASCII raw text/data. How do I go
> about it?

> Thanks in advance
> Stephan Schoombie

 
 
 

How to save Unix File to Dos/ASCII format?

Post by Annelise Anderso » Thu, 22 May 1997 04:00:00



Quote:> Hi

> I am not a Unix expert and therefore this question may sound silly.
> I need to get a file from a database-application called Notebook, the
> application is on a network running on Unix. I need to copy this file
> from the server into DOS format or ASCII raw text/data. How do I go
> about it?
> Thanks in advance
> Stephan Schoombie

One way is simply to move it from the unix system to the dos system,
open it with dos edit (if it's small enough, otherwise something that
takes larger files), make a small change (add a space somewhere, for
example), and save it.  This will convert the line endings to what
dos/Windows uses.

        Annelise

 
 
 

1. Program to convert Unix file format to DOS / Windows format.

Hi ,
    I just saw a request on this list for a program to convert DOS files

to Unix.
    I would like a program to convert Unix format to DOS

                                                            Thanks
                                                                    Mike

2. i2c driver changes for 2.5.66

3. copying files from unix to dos system in dos readable format

4. How can a process read its user_t data?

5. ### Need HELP to rescue Unix-ASCII files loaded from DOS floppy

6. online tech support sites

7. storing a unix file in dos format!!!!!!!!!!!!!

8. Does anyone know how to send UDP packet through HTTP proxy?

9. dos file convert to unix format

10. Check file format (dos or unix)

11. Unix Script to convert text files to DOS format?

12. collection: converting DOS files to UNIX format

13. Converting Windows/DOS files to a Unix format.