2012-08-27 44 views

回答

0

你可以在Python試試這個:

def grepFileForLines(self, fileName = "", keepLinesWith = ""): 
    fileObj = open(fileName, 'r') 
    matches = [] 
    for line in fileObj: 
     if line.find(keepLinesWith) > -1: 
      matches.append(line) 
    return matches 
+0

真棒..所以我應該做文件名的變量,將環通百個HTML文件? –