[comp.unix.questions] Questions on using pr and cat...

rcte2p@menudo.uh.edu (Paul Stephen Sears) (01/10/91)

I have some questions about pr and cat.  I want to combine a number of
small text files into a single file.  Many of these files are less than
one page long.  They are not also very nicely formatted.  I thought of
using cat, but the files run together and I wanted a way to identify
each new file.  So I considered using pr since it puts on headers and
footers... Now, what I want to be able to do in pr is to KEEP the
headers and to remove the footers since, only one file will be put on a
page and that is what I am trying to avoid.  If I do a pr -t *, I get
all the files together, but I loose the header that separated the files.
I guess, I would like something like the VMS command print/nofeed/header
*.  Any ideas?


-- 
Paul Sears      The Univ. of Houston |"The greater an individual's power
Student of the College of Technology | over others, the greater the evil that
RCTE2P@Jetson.uh.edu      ***        | might possibly originate with him."  
RCTE2P@menudo.uh.edu     * * *       | - PROPAGANDA, from A Secret Wish (CD)

raja@bombay.cps.msu.edu (Narayan S. Raja) (01/10/91)

In article <1991Jan9.211742.16190@menudo>, (Paul Stephen Sears) writes:

< I have some questions about pr and cat.  I want to combine a number of
< small text files into a single file.  Many of these files are less than
< one page long.  They are not also very nicely formatted.  I thought of
< using cat, but the files run together and I wanted a way to identify
< each new file.  So I considered using pr since it puts on headers and
< footers... Now, what I want to be able to do in pr is to KEEP the
< headers and to remove the footers since, only one file will be put on a


more * > tempfile


Narayan Sriranga Raja.

det@hawkmoon.MN.ORG (Derek E. Terveer) (01/12/91)

rcte2p@menudo.uh.edu (Paul Stephen Sears) writes:

>I have some questions about pr and cat.  I want to combine a number of
>small text files into a single file.  [...] one page long.  I thought of
>using cat, but the files run together and I wanted a way to identify
>each new file.

You could try the following:

pr * | uniq


This will provide you with headers for each file, but uniq will filter out
superfluous line feeds at the end of each file...
-- 
Derek "Tigger" Terveer	det@hawkmoon.MN.ORG - MNFHA, NCS - UMN Women's Lax, MWD
I am the way and the truth and the light, I know all the answers; don't need
your advice.  -- "I am the way and the truth and the light" -- The Legendary Pink Dots