Wednesday, September 28, 2011

Editing a log file

#!/usr/bin/python
#To print a list of numbers
import string

log_file = "20110923 10.0.0.1 1110 192.168.1.1 80 404 vaka.html"
print log_file
print "The type of log_file is : ", type(log_file)
print string.split(log_file)
log_file2 = string.split(log_file)
print "The type of log_file2 is: ", type(log_file2)
print "The date in our log file is : ", log_file2[0]
log_file3 = string.join(log_file2)
print "The type of log_file3 is : ", type(log_file3)


No comments:

Post a Comment