Advertisement
metalx1000

sdr gps file converter to single csv

Nov 2nd, 2017
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.20 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2017 Kris Occhipint.
  4. # http://filmsbykris.com
  5. # License: https://www.gnu.org/licenses/gpl-3.0.txt
  6. # RadioPower
  7. # This program is free software: you can redistribute it and/or modify  
  8. # it under the terms of the GNU General Public License as published by  
  9. # the Free Software Foundation, version 3.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #       :GPLv3
  19. #====================================================================
  20.  
  21. grep -e '$GPRMC' "$1"|grep '^15'|while read line;
  22. do
  23.   ts="$(echo "$line"|cut -d\- -f1)"
  24.   echo -n "$ts,"
  25.   grep "$ts" "$1"|grep -e '$GPRMC'|grep ',N,'|\
  26.     grep ',W,'|\
  27.     cut -d\, -f4,5,6,7|\
  28.     grep ',08'|
  29.     while read l;
  30.     do
  31.       echo -n "${l}',"
  32.         #sed "s/,0/0',-/g";
  33.       grep "$ts" "$1"|grep -e 'POWER'|cut -d\, -f3,4,7,8
  34.     done
  35.   done|grep '^15'|grep -v -e 'nan' -e 'A,'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement