Created
August 9, 2021 13:50
-
-
Save takunoko/57c02d5ccc8084a6f1a96f547987a197 to your computer and use it in GitHub Desktop.
FT3DのGPSログを(緯度,経度,標高)のCSVに変換
This file contains 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
#!/bin/sh | |
FILE_NAME="210731081630.log" | |
OUTPUT_NAME="output.csv" | |
nkf -Lu ${FILE_NAME} | grep GPGGA | awk -F "," '{ | |
if ( $3 != "" ) { | |
N=$3 | |
E=$5 | |
H=$10 | |
N_D=substr($3, 1, 2) | |
N_M=substr($3, 3, 9) | |
E_D=substr($5, 1, 3) | |
E_M=substr($5, 4, 10) | |
printf("%d.%d, ", N_D, (N_M*10000)/60) | |
printf("%d.%d, ", E_D, (E_M*10000)/60) | |
printf("%.1f\n", H) | |
} | |
}' >| ${OUTPUT_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment