Daniel,

The following code will do.

undef $/;

open (INPUT, "test") || die "Can't open the input file";

$data=<INPUT>;
close INPUT;

open (OUTPUT, ">test") || die "Can't open the output file";
$data =~ s/1/0/g;
print OUTPUT $data;
close OUTPUT;

Cheers,
Gary

-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 2 October 2001 12:54
To: [EMAIL PROTECTED]
Subject: Modifying a text file with perl.


List,

I have comma seperated text file here with 3 entries per line...

hello, world, 1

Is it possible with perl to change that value of 1 to 0?

Regards,

Daniel Falkenberg

==============================
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email:  [EMAIL PROTECTED]
WWW:    http://www.vintek.net
Tel:    (08) 8523 5035
Fax:    (08) 8523 2104
Snail:  P.O. Box 312
        Gawler   SA   5118
==============================


-- 
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]

Reply via email to