Home » Infrastructure » Linux » Create DOS text file in Linux
Create DOS text file in Linux [message #215854] Wed, 24 January 2007 01:45 Go to next message
Messages: 1
Registered: January 2007
Location: Indonesia
Junior Member


I have this problem. I have to create a text file. I generate the file using Oracle Reports, using function text_io.put_line. This system is run on Linux.

The problem is the text file is supposed to be uploaded to another system, which expecting a DOS text format. It shows error when we tried to upload the text file.

So, I need to know is there anyway I can put the additional character (LF) so that my text file would become DOS text format?

Any other alternative method is welcome, as long as the user doesn't have to open it in an editor and convert to DOS format. As much as possible I want to avoid manual work.


Dapid Candra
Re: Create DOS text file in Linux [message #215887 is a reply to message #215854] Wed, 24 January 2007 03:18 Go to previous message
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
A few options come to mind :

1. "Upload" it to the other system using ftp in transfermode ASCII.

2. Use the "unix2dos" comand line tool to convert the file.

3. Put the additional character at the end of the text_io.put_line.

4. Use SED to change CR to CR/LF.

Whichever suits you best. Wink
Previous Topic: Lost Oracle Passwords_I am Root
Next Topic: RHEL AS4 minimum installation
Goto Forum:

Current Time: Sun Nov 27 13:11:31 CST 2022