Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copy multiples files to a single file in seperate pages..

0 views
Skip to first unread message

Wg

unread,
Mar 27, 2008, 3:30:30 PM3/27/08
to
Hi,

Trying to understand if we have a mechanism to copy multiple files
( txt files ) to a single file (say abc.txt) with each file residing
in single page. Each input file is large enough to fit into a single
page. I have tried using perl format's like $- and other mechanism in
vain.

Is there a way to insert a page character after reading each file or
seperate each file into different pages? Any suggestions other than
adding "\n" is greatly appreciated..

The goal of this exercise is to convert the single file (abc.txt) to
postscript file and then to pdf using ps2pdf utility.. Can't use cpan
modules as some of these input files contain unicode characters...

This post is more verbose but repeated as the earlier post didn't
appear in the group..

Thanks for your patience,
-Wg.

Willem

unread,
Mar 27, 2008, 3:34:44 PM3/27/08
to
Wg wrote:
) Hi,
)
) Trying to understand if we have a mechanism to copy multiple files
) ( txt files ) to a single file (say abc.txt) with each file residing
) in single page. Each input file is large enough to fit into a single
) page. I have tried using perl format's like $- and other mechanism in
) vain.
)
) Is there a way to insert a page character after reading each file or
) seperate each file into different pages? Any suggestions other than
) adding "\n" is greatly appreciated..
)
) The goal of this exercise is to convert the single file (abc.txt) to
) postscript file and then to pdf using ps2pdf utility.. Can't use cpan
) modules as some of these input files contain unicode characters...

What utility are you using to generate the postscript file ?
That should have some kind of documentation that describes what it uses
to separate pages.

If it doesn't, bad luck. You can probably generate several postscript
files, one for each page, and then use a simple utility to put those
together into one postscript file, or even directly into a pdf.

Or if you want to do it by hand, just generate the postscript directly
from the perl script. That shouldn't be too hard, actually.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

smallpond

unread,
Mar 27, 2008, 6:00:13 PM3/27/08
to


You can try inserting form feed = chr(12) which some conversion
utilities will interpret as a page break according to the ASCII
chart on my pocket protector.
--S

Jürgen Exner

unread,
Mar 27, 2008, 9:35:54 PM3/27/08
to
Wg <techrep...@gmail.com> wrote:
>Trying to understand if we have a mechanism to copy multiple files
>( txt files ) to a single file (say abc.txt) with each file residing
>in single page. Each input file is large enough to fit into a single
>page. I have tried using perl format's like $- and other mechanism in
>vain.
>
>Is there a way to insert a page character after reading each file or
>seperate each file into different pages? Any suggestions other than
>adding "\n" is greatly appreciated..

On the level of text files a FormFeed character (FF, ASCII 0x0C)
_should_ result in a page break.

>The goal of this exercise is to convert the single file (abc.txt) to
>postscript file and then to pdf using ps2pdf utility..

Another approach would be to convert the individual files first and then
merge the PS or even the PDF files into one large file. I am sure there
are tools to join individual PS/PDF files.

>Can't use cpan
>modules as some of these input files contain unicode characters...

I hope all of them are Unicode only, because I would guess you probably
would have some serious problems with the conversion to PS and PDF if
there were any non-Unicode characters in those files.
But it would be a very unusual text indeed if it consists of non-Unicode
characters only. After all somewhere I've heard that even Klingon
characters and Babylonian cuneiform are included in Unicode somewhere.

jue

0 new messages