Solved

Looking for a pgm to convert unix lf to dos

Posted on 1998-11-04
7
282 Views
Last Modified: 2013-12-23
Hi,
I want to convert some files to unix format to dos (W95) format. The main problem is with end of line. I have line feed only  instead cr and lf
Does it exist some utility to convert this files
Thanks
0
Comment
Question by:didede
7 Comments
 
LVL 84

Expert Comment

by:ozo
Comment Utility
awk '{print  $0 "\r"}' < unixfile > dosfile
0
 

Author Comment

by:didede
Comment Utility
Thanks but i'am not the productor of the unix files and i have only W95 based plate-forme. Can you give me the same syntaxe in dos please.

0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
On DOS/W95 you either need an editor which can handle your needs, or you need some commands to do it, like awk, perl, etc.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:tfabian
Comment Utility
am I missing something??

most UNIX systems I've seen / worked on, come with two programs that accomplish this..

one is unix2dos and the other is dos2unix

from the man pages:


Date: Thu, 5 Nov 1998 08:28:32 -0500 (EST)
From: tfabian (Theodore Fabian)
To: tfabian

r stuff
~r stuff



DOS2UNIX(1)              USER COMMANDS                DOS2UNIX(1)



NAME
     dos2unix - convert text file from DOS format to ISO format

SYNOPSIS
     dos2unix [ -ascii ] [ -iso ] [ -7 ] _o_r_i_g_i_n_a_l_f_i_l_e  _c_o_n_v_e_r_t_e_d_-
     _f_i_l_e

DESCRIPTION
     dos2unix converts characters in the DOS  extended  character
     set to the corresponding ISO standard characters.

     This command can be invoked from either DOS or SunOS.   How-
     ever,  the  filenames must conform to the conventions of the
     environment in which the command is invoked.

     If the original file and the converted file  are  the  same,
     dos2unix will rewrite the original file after converting it.

OPTIONS
     -ascii
          Removes extra carriage returns and converts end of file
          characters in DOS format text files to conform to SunOS
          requirements.

     -iso This is the default.  It converts characters in the DOS
          extended  character  set to the corresponding ISO stan-
          dard characters.

     -7   Convert 8 bit DOS graphics characters to  7  bit  space
          characters so that SunOS can read the file.

DIAGNOSTICS
     File _f_i_l_e_n_a_m_e not found, or no read permission
          The input file you specified does not exist, or you  do
          not  have  read  permission (check with the SunOS ls -l
          command).

     Bad output filename _f_i_l_e_n_a_m_e, or no write permission
          The output file you specified is either invalid, or you
          do  not  have  write  permission  for  that file or the
          directory that contains it.  Check also that the  drive
          or diskette is not write-protected.

     Error while writing to temporary file
          An error occurred while converting your file,  possibly
          because there is not enough space on the current drive.
          Check the amount of space on the  current  drive  using
          the  DIR  command.   Also  be  certain that the default
          diskette  or  drive  is   write-enabled   (not   write-
          protected).  Note that when this error occurs, the ori-
          ginal file remains intact.




Sun Release 4.1    Last change: 7 October 1990                  1






DOS2UNIX(1)              USER COMMANDS                DOS2UNIX(1)



     Could not rename temporary file to
     Translated temporary file name = _f_i_l_e_n_a_m_e.
          The program could not perform the final  step  in  con-
          verting  your file. Your converted file is stored under
          the name indicated on the second line of this message.
SEE ALSO
     dos(1), unix2dos(1)

     _S_u_n_3_8_6_i _A_d_v_a_n_c_e_d _S_k_i_l_l_s
     _S_u_n _M_S-_D_O_S _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l













































Sun Release 4.1    Last change: 7 October 1990                  2






UNIX2DOS(1)              USER COMMANDS                UNIX2DOS(1)



NAME
     unix2dos - convert text file from ISO format to DOS format

SYNOPSIS
     unix2dos [ -ascii ] [ -iso ] [ -7 ] _o_r_i_g_i_n_a_l_f_i_l_e  _c_o_n_v_e_r_t_e_d_-
     _f_i_l_e

DESCRIPTION
     unix2dos converts ISO standard characters to the correspond-
     ing characters in the DOS extended character set.

     This command may be invoked from either DOS or SunOS.   How-
     ever,  the  filenames must conform to the conventions of the
     environment in which the command is invoked.

     If the original file and the converted file  are  the  same,
     unix2dos will rewrite the original file after converting it.

OPTIONS
     -ascii
          Adds carriage returns and converts end of file  charac-
          ters  in  SunOS  format  text  files  to conform to DOS
          requirements.

     -iso This is the default.  Converts ISO standard  characters
          to  the  corresponding  character  in  the DOS extended
          character set.

     -7   Convert 8 bit SunOS characters to 7 bit DOS characters.

DIAGNOSTICS
     File _f_i_l_e_n_a_m_e not found, or no read permission
          The input file you specified does not exist, or you  do
          not  have read permission (check with the SunOS command
          ls -l).

     Bad output filename _f_i_l_e_n_a_m_e, or no write permission
          The output file you specified is either invalid, or you
          do  not  have  write  permission  for  that file or the
          directory that contains it.  Check also that the  drive
          or diskette is not write-protected.

     Error while writing to temporary file
          An error occurred while converting your file,  possibly
          because there is not enough space on the current drive.
          Check the amount of space on the  current  drive  using
          the  DIR  command.   Also  be  certain that the default
          diskette  or  drive  is   write-enabled   (not   write-
          protected).  Note that when this error occurs, the ori-
          ginal file remains intact.

     Could not rename tmpfile to _f_i_l_e_n_a_m_e.



Sun Release 4.1    Last change: 7 October 1990                  1






UNIX2DOS(1)              USER COMMANDS                UNIX2DOS(1)



     Translated tmpfile name = _f_i_l_e_n_a_m_e.
          The program could not perform the final  step  in  con-
          verting  your file. Your converted file is stored under
          the name indicated on the second line of this message.
SEE ALSO
     dos(1), dos2unix(1)

     _S_u_n_3_8_6_i _A_d_v_a_n_c_e_d _S_k_i_l_l_s
     _S_u_n _M_S-_D_O_S _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l














































Sun Release 4.1    Last change: 7 October 1990                  2






0
 
LVL 5

Expert Comment

by:bchew
Comment Utility
tfabian,

Yes, you are missing something...didede specifically asked for a converter that runs under DOS not UNIX!!!


0
 
LVL 3

Expert Comment

by:elfie
Comment Utility
reject the previous answer and look at the site

http://garbo.uwasa.fi/pc/unix.html

In there you will find unix2dos.zoo.

This contains the pc equivalent programs for ux2dos and dos2ux.

I'm currently using them the get ride of the lf/cr problems when sending ascii files from/to unix.
0
 
LVL 3

Accepted Solution

by:
elfie earned 20 total points
Comment Utility
Did my previous comment solved your problem?
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Fiber Patch Panel 6 42
CISCO refresh sheets 2 33
Monitoring and Identifying Data Leaving the Newtork 3 64
MAC Needs 2 Domains 2 42
What is IRC? IRC (Internet Relay Chat) is a form of communication between multiple users. It is available freely to anyone with inernet access. IRC is a great way to communicate with others e.g. There is an IRC channel for Ubuntu Linux, which is fo…
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now