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

Discussion in 'Perl Misc' started by Wg, Mar 27, 2008.

  1. Wg

    Wg Guest

    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.
    Wg, Mar 27, 2008
    #1
    1. Advertising

  2. Wg

    Willem Guest

    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
    Willem, Mar 27, 2008
    #2
    1. Advertising

  3. Wg

    smallpond Guest

    On Mar 27, 3:30 pm, 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...
    >
    > 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
    smallpond, Mar 27, 2008
    #3
  4. Wg <> 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
    Jürgen Exner, Mar 28, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FD
    Replies:
    0
    Views:
    813
  2. moondaddy
    Replies:
    2
    Views:
    562
    Steven Cheng[MSFT]
    Oct 16, 2006
  3. SHC
    Replies:
    0
    Views:
    372
  4. macm
    Replies:
    1
    Views:
    194
    Ian Kelly
    Nov 11, 2010
  5. SHC
    Replies:
    6
    Views:
    166
    -Lost
    Mar 29, 2007
Loading...

Share This Page