Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: read_log.py

Issue 3018633002: add a read_log.py flie
Patch Set: add a read_log.py flie Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import os
2
3 FOLDER = "/Users/liangzijie/Desktop/testdemo/lx3/out/"
01tonythomas 2017/09/25 19:55:09 We cannot have this going into the program, but I
4 FLAG = "OVERALL"
5
6
7 def read_file(filename, pattern):
01tonythomas 2017/09/25 19:55:09 minor, but for next time - the function name shoul
8 with open(filename) as f:
9 lines = f.readlines()
10 for line in lines:
11 if pattern in line:
12 print(line.strip())
13
14
15 for each_file in os.listdir(FOLDER):
16 if each_file.startswith("2017"):
17 filename = os.path.join(FOLDER + each_file, "load.ycsb.log")
18 if os.path.exists(filename):
19 read_file(filename, FLAG)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698