Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FT3DのGPSログを(緯度,経度,標高)のCSVに変換
#!/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