This is the program;
format ILL =
@<<<<<<
$number
..
open (INPUT_FILE, "$DATA_DIR/opacrequests.LN.out") || die "Cannot open
$DATA_DIR/opacrequests.LN.out: $!";
open (ILL, ">$OUT_DIR/pobk_rpt.txt") || die "Cannot open
$OUT_DIR/pobk_rpt.txt: $!";
while ($_=<INPUT_FILE>) {
chop $_ ;
($number, $date_time, $patron_name, $patron_barcode, $address, $field6,
$field7, $author, $title, $place, $publisher, $edition, $date) = split
/\t/,$_;
write (ILL);
}
but as the textfile I'm reading in from has the format;
first line of text
(blank line)
second line of text
when I write to the new textfile taking the content from the original
textfile it's still including the blank line when I don't want it to.
Can you change a delimiter?
> -----Original Message-----
> From: Carl Rogers [SMTP:[EMAIL PROTECTED]]
> Sent: 29 November 2001 12:59
> To: [EMAIL PROTECTED]
> Subject: Re: newlines
>
> At 10:35 AM 11/29/2001 +0000, [EMAIL PROTECTED] wrote:
> >Anyone know how to get rid of two new lines from one text file before
> >writing to another
>
> I'm sorry.I'm not clear as to what you mean. If you're trying to read the
> lines below, you can change your default record delimiter from a single
> newline character to anything else, including two \n characters
>
> $/ = "\n\n" ## although I believe $/ = "" would work as well.
>
> >i.e.
> >
> >line of text
> >
> >line of text
> >
> >I can get rid of one newline with chop but can't think of how to delete
> two?
>
> maybe chomp would work with the change to $/. Give it a try. If you post
> more information and describe what you're desired output is, maybe I can
> be
> of more help.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]