🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #7991

Re: What is the best way to write this small program.

#7991
From: John Savage
Date: Sun, 10 Mar 1996 00:00
25 lines
2173 bytes
ardee@ix.netcom.com(i+1 ) writes:
>I need to write a program that will take an input file and do the
>following things to it:
>
>1) paste a control character at the beginning of the file to cause it
>to print in landscape mode and....
>
>2) Replace any 1's that are on a line by themselves with a formfeed
>character.

Provided the file is a text file (all chars < 128 ASCII) then you could
use the Un*x style stream editor to perform the editing tasks:

sed -e '1s/^/*/' -e 's/^1$/*/' <$1 >>tmp.prn
type tmp.prn>lpt1

Note: replace the asterisks with your desired control characters < 128

ftp ftp cdrom.com /pub/simtel/vendors/gnu/gnuish/
gsed-203.zip  B  164015  931219  GNU stream editor version 2.03. Src included

ftp ftp.cdrom.com /pub/simtel/msdos/textutil/
sed15x.zip    B   21163  911015  Unix-compatible streaming editor v1.5 EXE/docs
--
John Savage               koala@sydney.dialix.com.au
Technical Details
Message-ID: <4hubqo$3ls$1@sydney.DIALix.oz.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4hhn5g$88t@mozo.cc.purdue.edu> <4hhqon$o7m@cloner2.ix.netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f6aa,d9ccd4b8c35c5c85
X-Google-Attributes: gid10f6aa,public
X-Google-Thread: 10d683,b6aaeae96491e0d5,start
X-Google-Attributes: gid10d683,public
X-Google-Thread: f53ba,b6aaeae96491e0d5,start
X-Google-Attributes: gidf53ba,public
X-Google-Thread: f71eb,b6aaeae96491e0d5,start
X-Google-Attributes: gidf71eb,public
X-Google-Thread: 1674b9,b6aaeae96491e0d5,start
X-Google-Attributes: gid1674b9,public
X-Google-Thread: 111d31,b6aaeae96491e0d5,start
X-Google-Attributes: gid111d31,public
X-Google-Thread: 104805,b6aaeae96491e0d5,start
X-Google-Attributes: gid104805,public
From: John Savage <koala@sydney.dialix.com.au>
Subject: Re: What is the best way to write this small program.
Date: 1996/03/10
Message-ID: <4hubqo$3ls$1@sydney.DIALix.oz.au>
X-Deja-AN: 142245441
sender: koala@sydney.DIALix.oz.au
references: <4hhn5g$88t@mozo.cc.purdue.edu> <4hhqon$o7m@cloner2.ix.netcom.com>
followup-to: comp.os.msdos.programmer,comp.os.msdos.misc,alt.msdos.batch
organization: Gumleaf Smoke Signals Telegraph Co.
newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc,alt.msdos.batch,comp.binaries.ibm.pc.wanted,comp.archives.msdos.d,comp.sys.ibm.pc.misc,aus.computers.ibm-pc