Click here to get back home

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

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Copy multiples files to a single file in seperate pages.. Wg 03-27-2008
Posted by Wg on March 27, 2008, 3:30 pm
Please log in for more thread options
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.

Posted by Willem on March 27, 2008, 3:34 pm
Please log in for more thread options
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

Posted by smallpond on March 27, 2008, 6:00 pm
Please log in for more thread options
> 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.


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

Posted by Jürgen Exner on March 27, 2008, 9:35 pm
Please log in for more thread options
>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

Similar ThreadsPosted
Use of CGI.pm filehandle with File::Copy::copy in taint mode May 5, 2006, 3:57 pm
"copy" from File::Copy fails but returns success October 16, 2007, 4:43 am
Simple (!) HTML/PERL code fpr uploading files through web pages entyr field ?? November 18, 2004, 11:12 pm
copy all files August 6, 2007, 4:31 am
copy directory structure without files February 8, 2005, 6:58 am
perl script to copy mp3 files to your portable mp3 device - inetquestion September 14, 2004, 1:51 pm
File::Copy giving "Bad File Descriptor" from sysread October 3, 2004, 11:33 am
multiples ifs April 29, 2005, 5:14 pm
File::Copy works, File::NCopy doesn't September 13, 2005, 1:56 pm
Installing seperate version of Perl. July 10, 2004, 8:38 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap