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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIX ascii text to msdos text conversion script

Status
Not open for further replies.

zoonkai

MIS
May 1, 2000
71
US
We are implementing paperless office software at my company. The software has weird formatting issues when I use UNIX created text. I used a Windows based program called Konvertor to convert to msdos text format and things appear to be fine. My question is, I want to do the conversion using UNIX, NOT Windows. My desire is to have a directory in UNIX with raw text from UNIX, and then after the UNIX command is run it moves everything to a processed directory, ready for input to the paperless office program.

I'm not opposed to writing a shell script to do this, but am very weak in scripting knowledge.

Any suggestions would be greatly appreciated.

Thank You,
Donald Dixon
Don-Nan Pump & Supply Co. Inc.
zoonkai@don-nan.com
Bus. (915) 682-7742
Donald (Zoonkai) Dixon
donnan@don-nan.com

Donald (Zoonkai) Dixon
donnan@don-nan.com
 
Check out the unix2dos command. This converts Unix text files into Dos format, try it out and if your output file is readable in Windows then you should be able to script it up fairly easily.

Hope this helps.


John
 
when i do
# man unix2dos on my test system I get information..but when i do it on my main system i
# man unix2dos
man: unix2dos not found

when i try to run the command on either system i get:
# unix2dos test test2
unix2dos: not found
# unix2dos test > test2
unix2dos: not found

any ideas

I'm running SCO UNIX 5.0.5

thanx

Donald (Zoonkai) Dixon
donnan@don-nan.com
 
Hi

The commands dos2unix and unix2dos are part of the SCO PC-Interface for Unix package which in turn is part of the SCO Openserver Enterprise System Connectivity package.

You can see if you have installed these by running custom and expanding the Connectivity package. I think that PCI is probably only installed on your live machine.

The reason you get an error on this machine is that the command is not in your PATH. You need to find it by using the command find / -name unix2dos -print, you can then fully qualify the path for execution.

Hope this proves of help.


John


 
sco does have a default converter
unix to dos = xtod
dos to unix = dtox

the script would go something like this

cd /sourcedir
for i in `ls filepattern`
do
xtod $i > /targetdir/$i
done

good luck.
stan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top