File Handling problem.
Hi, Current task requires me to combine a few files into a single file ( abc. txt ) where in each file has to be in a single page. I was able to create a combined file, but not able to ensure that each file resides in a page. Attempted a few things like 'format_lines_left' i.e $-. in vain... One of the possibilities left with me is to give sufficient "\n" between each file that way ensuring that each file read in resides in a page (which is something that I would like to do at the last). Is there any other mechanism that can be done to ensure that each file resides in a page.. say page break character or something... Any help would be appreciated... Thanks, -Wg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
Re: File Handling problem.
Text files don't /have/ "pages". The number of lines per page depends on the printer driver -> the font size, margin size, etc. If you know the number of lines the print driver does per page, you can fill to that point with newlines based on the number of lines already outputted. Or you might be interested in a PostScript/PDF module from CPAN... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
Re: File Handling problem.
On Mar 28, 1:35 am, [EMAIL PROTECTED] (Ay) wrote: > Hi, > > Current task requires me to combine a few files into a single file > ( abc. txt ) where in each file has to be in a single page. I was able > to create a combined file, but not able to ensure that each file > resides in a page. Attempted a few things like 'format_lines_left' > i.e $-. in vain... One of the possibilities left with me is to give > sufficient "\n" between each file that way ensuring that each file > read in resides in a page (which is something that I would like to do > at the last). Is there any other mechanism that can be done to ensure > that each file resides in a page.. say page break character or > something... The traditional page break character for text files is the form-feed character, which is ascii 12, 0x0C, \f in Perl and C, or ^L if you use Emacs. There's more information here: http://en.wikipedia.org/wiki/Form_feed and in Google. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/