回答編集履歴
1
Update
answer
CHANGED
@@ -10,17 +10,17 @@
|
|
10
10
|
|
11
11
|
df = pd.read_table(log_file, header=None)
|
12
12
|
df = df[~df[0].str.match(r'.*(MAC Address|VLAN Pool Name)')]
|
13
|
-
|
13
|
+
df = (
|
14
14
|
df.groupby(df[0].str.match(rf'^({weekday}) ').cumsum())
|
15
15
|
.apply(lambda x:
|
16
16
|
pd.DataFrame([[x.iloc[0, 0]] + i for i in x.iloc[1:,0].str.split()]))
|
17
17
|
.reset_index(drop=True))
|
18
|
-
|
18
|
+
df.columns = header
|
19
19
|
|
20
|
-
|
20
|
+
df.to_csv('sample.csv', index=False)
|
21
21
|
```
|
22
22
|
|
23
|
-
**
|
23
|
+
**sample.csv**
|
24
24
|
```csv
|
25
25
|
Time Stamp,MAC Address,IP Type,APID,AP Name,L2 Mode,L3 Mode,Tag/ID,RF Band,IP Mode,Client IP,Station Type,OS Type
|
26
26
|
Wed Sep 15 17:26:27 JST 2021,aa:aa:aa:aa:aa:aa,Discovered,244,AP1,wpa2-psk,clear,0,802.11bgn2s20,IPv4,192.168.201.175,wireless,370103060f1f212b2c2e2f7779f9fc
|