?
Solved

Looking for a pgm to convert unix lf to dos

Posted on 1998-11-04
7
Medium Priority
?
296 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 85

Expert Comment

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

Author Comment

by:didede
ID: 1582550
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
ID: 1582551
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:tfabian
ID: 1582552
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
ID: 1582553
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
ID: 1582554
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 60 total points
ID: 1582555
Did my previous comment solved your problem?
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
WARNING:   If you follow the instructions here, you will wipe out your VTP and VLAN configurations.  Make sure you have backed up your switch!!! I recently had some issues with a few low-end Cisco routers (RV325) and I opened a case with Cisco TA…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

839 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