Skip to content

Instantly share code, notes, and snippets.

@takunoko
Created August 9, 2021 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takunoko/57c02d5ccc8084a6f1a96f547987a197 to your computer and use it in GitHub Desktop.
Save takunoko/57c02d5ccc8084a6f1a96f547987a197 to your computer and use it in GitHub Desktop.
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