Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > reg:file handli...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 10741 of 11992
Post > Topic >>

reg:file handling

by gowrib@[EMAIL PROTECTED] (Gowri Chandra Sekhar Barla) Mar 16, 2008 at 06:10 PM

------_=_NextPart_001_01C88762.E30EBEE7
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Hi

=20

I am unable to modify the input file ,

=20

If I am redirecting output to with different file name it working fine

=20

=20

In want to replace name in a file

=20

Script: problem

=20

print " Enter the file Name \n";

$filename =3D <STDIN>;

open(INPUT,"<$filename");

open(OUTPUT,">filename");

while(<INPUT>)

{

if($_ =3D~ s/FRCC/FRE/)

{

print OUTPUT "$_";

}

else

{

print OUTPUT "$_";

=20

}

=20

Script: No problem script working fine

=20

print " Enter the file Name \n";

$filename =3D <STDIN>;

open(INPUT,"<$filename");

open(OUTPUT,">new1=2Ec");

while(<INPUT>)

{

if($_ =3D~ s/FRCC/FRE/)

{

print OUTPUT "$_";

}

else

{

print OUTPUT "$_";

=20

}

=20

=20

Please help me

=20

=20

Thanks and regards

Chandu

=20



DISCLAIMER:
---------------------------------------------------------------------------=
--------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and=
 intended for the named recipient(s) only=2E
It shall not attach any liability on the originator or HCL or its=
 affiliates=2E Any views or opinions presented in=20
this email are solely those of the author and may not necessarily reflect=
 the opinions of HCL or its affiliates=2E
Any form of reproduction, dissemination, copying, disclosure,
modification,=
 distribution and / or publication of=20
this message without the prior written consent of the author of this
e-mail=
 is strictly prohibited=2E If you have
received this email in error please delete it and notify the sender=
 immediately=2E Before opening any mail and=20
attachments please check them for viruses and defect=2E

---------------------------------------------------------------------------=
--------------------------------------------
------_=_NextPart_001_01C88762.E30EBEE7--
 




 4 Posts in Topic:
reg:file handling
gowrib@[EMAIL PROTECTED]   2008-03-16 18:10:16 
Re: reg:file handling
krahnj@[EMAIL PROTECTED]   2008-03-16 09:27:01 
Re: reg:file handling
noreply@[EMAIL PROTECTED]  2008-03-16 20:11:51 
Re: reg:file handling
krahnj@[EMAIL PROTECTED]   2008-03-16 15:09:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 11:04:36 CDT 2008.