[comp.unix.xenix] converting line-feed to cr/lf in a file

wbader@scarecrow.mse.lehigh.edu (William Bader) (10/24/89)

You can use the Xenix utilities dotx and xtod.

barton@holston.UUCP (Barton A. Fisk) (10/24/89)

For reasons beyond my control (US Govt Computer System) I have
to translate all line-feed characters in my SCO Xenix system
text file to cr/lf's before sending them to a DOS front end
pre-editing site that bombs on lf's only.

I've tried using stty, but it seems this only works for 
character dev's not files. 

I'm probably missing something really simple here, it's been
a long day.

Would someone point me to the right utility, I'm not a C programmer
or I'm sure a simple C program would do it.

Any help appreciated.
-- 
Barton A. Fisk          | UUCP: {attctc,texbell,vector}!warble!holston!barton
PO Box 1781             | (PSEUDO) DOMAIN: barton@holston.UUCP     
Lake Charles, La. 70602 | ----------------------------------------
318-439-5984            | "Let him who is without sin cast the first stone"-JC

maart@cs.vu.nl (Maarten Litmaath) (10/24/89)

	$ cat xenix-to-dos
	:
	exec sed 's/$/^M/' ${1+"$@"}
	$ cat dos-to-xenix
	:
	exec sed 's/.$//' ${1+"$@"}
	$

(where ^M stands for ctrl-M)
-- 
A symbolic link is a POINTER to a file, | Maarten Litmaath @ VU Amsterdam:
 a hard link is the file system's GOTO. | maart@cs.vu.nl, mcsun!botter!maart

msschaa@cs.vu.nl (Schaap MS) (10/24/89)

In article <636@holston.UUCP> barton@holston.UUCP (Barton A. Fisk) writes:
>For reasons beyond my control (US Govt Computer System) I have
>to translate all line-feed characters in my SCO Xenix system
>text file to cr/lf's before sending them to a DOS front end
>pre-editing site that bombs on lf's only.
>

A while ago, there have been posted on comp.binaries.ibm.pc
two programs (with source) dos2unix and unix2dos, which handle
this.

Michael

jpr@dasys1.UUCP (Jean-Pierre Radley) (11/04/89)

In article <636@holston.UUCP> barton@holston.UUCP (Barton A. Fisk) writes:
>For reasons beyond my control (US Govt Computer System) I have
>to translate all line-feed characters in my SCO Xenix system
>text file to cr/lf's before sending them to a DOS front end
>pre-editing site that bombs on lf's only.
>I've tried using stty, but it seems this only works for 
>character dev's not files. 

May I point out that your Subject line is misleading. If you just wanted
to change things in a file, a simple sed script would do the trick.

It seems that you need to change lf to cr/lf << when transmitting a file
to another machine >>.

If you have Compuserve access, grab XCMALT from LIB 5 of the TANGENT
Forum.

If you don't. E-mail me and I will send you the source.

XCMALT has an option to do the translation you ask for when transmitting
files. It will also perform put and take operations, or transfers using
xmodem or CompuServe B-Protocol. It can use scripts to automate logins
to foreign systems. It can also capture your remote session to a file.
-- 
Jean-Pierre Radley					      jpr@jpradley.uucp
New York, NY					      72160.1341@compuserve.com

bill@bilver.UUCP (Bill Vermillion) (11/05/89)

->In article <636@holston.UUCP> barton@holston.UUCP (Barton A. Fisk) writes:
->>For reasons beyond my control (US Govt Computer System) I have
->>to translate all line-feed characters in my SCO Xenix system
->>text file to cr/lf's before sending them to a DOS front end
->>pre-editing site that bombs on lf's only.
->>I've tried using stty, but it seems this only works for 
->>character dev's not files. 

The doscp command automatically adds cr's to the lf when you copy a text file
to a dos disk.
-- 
Bill Vermillion - UUCP: {uiucuxc,hoptoad,petsd}!peora!tarpit!bilver!bill
                      : bill@bilver.UUCP