forked from BaiqingL/AWSY
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessCSV.py
More file actions
31 lines (23 loc) · 790 Bytes
/
Copy pathprocessCSV.py
File metadata and controls
31 lines (23 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import csv
# Declare class to make things easier
class entry:
def __init__(self, BSSID, LAT, LONG):
self.BSSID = BSSID
self.LAT = LAT
self.LONG = LONG
# LIst of entries
entries = []
"""
Data formatted as id,BSSID,EMPTY,EMPTY,LAT,LONG,openbmap,num,date,date.
Only need three data points, so data needs to be isolated
"""
with open('wifi_zone.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
data = entry(row[1],row[4],row[5])
entries.append(data)
# Writing processed data to CSV file
with open('processed.csv', mode = 'w') as processedfile:
writer = csv.writer(processedfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
for data in entries:
writer.writerow([data.BSSID, data.LAT, data.LONG])