[Tutor] Newbie with question about text file processing
stuart_clemons@us.ibm.com
stuart_clemons@us.ibm.com
Mon, 22 Apr 2002 10:50:36 -0400
--0__=0ABBE130DFDCF32C8f9e8a93df938690918c0ABBE130DFDCF32C
Content-type: text/plain; charset=US-ASCII
Hi all:
I have an NT admin type of task that I'd like to try to do using Python,
which I'm just starting to learn.
Here's a simplied version of what I'm trying to do.
I have two text files, a master.txt and a newfile.txt. The master.txt
file has two fields, WINS and DNS. The newfile.txt has numerous fields,
including the WINS and DNS fields.
I would like to compare the values of the WINS and DNS fields in the
newfile.txt against the WINS and DNS values in the master.txt file to be
sure they match. I would like to write the results of the comparison to a
file, results.txt.
Here's the contents of master.txt:
WINS Server : 9.99.99.1
DNS Servers : 9.99.99.2
: 9.99.99.3
Here's the contents of newfile.txt
IP Address : 9.99.99.10
Gateway : 9.99.99.20
WINS Server : 9.88.88.88
Subnet : 255.255.255.0
DNS Servers: : 9.99.99.2
: 9.99.99.3
DHCP Server : 9.99.99.4
Any help will be greatly appreciated.
- Stuart
--0__=0ABBE130DFDCF32C8f9e8a93df938690918c0ABBE130DFDCF32C
Content-type: text/html; charset=US-ASCII
Content-Disposition: inline
<html><body>
<p>Hi all:<br>
<br>
I have an NT admin type of task that I'd like to try to do using Python, which I'm just starting to learn.<br>
<br>
Here's a simplied version of what I'm trying to do.<br>
<br>
I have two text files, a master.txt and a newfile.txt. The master.txt file has two fields, WINS and DNS. The newfile.txt has numerous fields, including the WINS and DNS fields.<br>
<br>
I would like to compare the values of the WINS and DNS fields in the newfile.txt against the WINS and DNS values in the master.txt file to be sure they match. I would like to write the results of the comparison to a file, results.txt.<br>
<br>
Here's the contents of master.txt:<br>
<br>
WINS Server : 9.99.99.1<br>
DNS Servers : 9.99.99.2<br>
: 9.99.99.3<br>
<br>
Here's the contents of newfile.txt<br>
<br>
IP Address : 9.99.99.10<br>
Gateway : 9.99.99.20<br>
WINS Server : 9.88.88.88<br>
Subnet : 255.255.255.0<br>
DNS Servers: : 9.99.99.2<br>
: 9.99.99.3<br>
DHCP Server : 9.99.99.4<br>
<br>
Any help will be greatly appreciated. <br>
<br>
- Stuart</body></html>
--0__=0ABBE130DFDCF32C8f9e8a93df938690918c0ABBE130DFDCF32C--