problem in reading file contents
Posted: Sat Jul 08, 2006 2:14 am
I want to read contents of an html file between body tags.
for example : here are contents of html file. and i want to fetch contents between <body bgcolor="#CCCCCC"> and </body> tags. then after doing the modification to this i want to replace between content between body tags using files, i need help in updating file, means when i am updating my file how i can search body tagas and then replace contets between them?
In simple words i want to put my content between <body ....> and </body> tags.
please guide me.
thanks much.
sample html file code.
for example : here are contents of html file. and i want to fetch contents between <body bgcolor="#CCCCCC"> and </body> tags. then after doing the modification to this i want to replace between content between body tags using files, i need help in updating file, means when i am updating my file how i can search body tagas and then replace contets between them?
In simple words i want to put my content between <body ....> and </body> tags.
please guide me.
thanks much.
sample html file code.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Sample File</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#CCCCCC">
<p>haya....</p>
<p>this is the required content </p>
</body>
</html>