Created
June 26, 2014 14:07
-
-
Save vallettea/89736788abee30bb8b71 to your computer and use it in GitHub Desktop.
script to clean SDK log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locations = filter(lambda line: line.split("|")[-1] == "loc-bg\r\n", open("log.csv")) | |
| def extract(line): | |
| items = line.split(",") | |
| timestamp = items[0].split("|")[0] | |
| lon = items[1] | |
| lat = items[2] | |
| return ";".join([timestamp, lon, lat]) | |
| locations = map(extract, locations) | |
| out = open("out.csv","w") | |
| out.write("ts;lon;lat\n") | |
| out.write("\n".join(locations)) | |
| out.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment