Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1298f9

Browse files
ファイル名の引用を改善
1 parent 0857fe4 commit a1298f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

txtToCsv.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ def create_data_from_file(file_name, keyword, device_code):
9797
data_json = {'TIME': []}
9898
keys = []
9999
i = 0
100+
index = KEYWORD_LIST.index(keyword);
100101

101-
if keyword == '':
102+
if index == -1:
102103
print('can not found keyword from file name...')
103104
sys.exit()
104105

@@ -107,7 +108,7 @@ def create_data_from_file(file_name, keyword, device_code):
107108
if row.find(device_code) > -1 and row.find('add device') == -1:
108109
key = str.strip(row[KEY_FROM:KEY_TO])
109110
# pixel4aの特別のデータを集めないように
110-
if keyword == 'pixel4a':
111+
if index == 1:
111112
if (key == 'ABS_MT_PRESSURE' and row[VALUE_FROM:VALUE_TO] == '00000000') or (
112113
key == 'ABS_MT_TRACKING_ID' and row[VALUE_FROM:VALUE_TO] == 'ffffffff'):
113114
continue

0 commit comments

Comments
 (0)