Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting AIX text files to DOS format

Status
Not open for further replies.

johnbv

Technical User
Sep 26, 2002
2
0
0
CA
I was wondering what the equivalent commands in AIX are for copying files to and from DOS format. The HP-UX has ux2dos and dos2ux. Someone suggested doswrite/dosread but this seems to be more for floppy disks.
Help!!
 
Quite simple:

doswrite -a inputfilename outputfilename

will do it. It converts the NL to a CRNL at the end of each record. This assumes the outputfilename is to a PCDOS formatted diskette.

The reverse is dosread -a inputfilename outputfilename

where inputfilename is assumed to be on the diskette inserted.

Of course there are other ways but this seems to be the closest to your question.
 
But what if you don't want to write the file to a diskette? I think that is johnbv's question.
 
I was wanting a utility to write to a file rather than the floppy device that the dosread/doswrite does. I tried downloading from ucla website but had proxy/ftp problems.
 
Hello johnbv,
I hope the script below helps you

#!/usr/bin/ksh
# $1 - input (unix format) file
# $2 -- output (dos format) file
rm -f $2 2> /dev/null
cat $1 |&
while read -p ul
do
echo "$ul\015" >> $2
done
regards boria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top