Python Forum
Split gps files based on time (text splitting)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split gps files based on time (text splitting)
#1
Hi all.
I have a gps file that has the following format. Someone said that it seems to be json file but I am not sure.

Segment of the file looks like that :
´
2020-10-12 14:30:23: {"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14}
2020-10-12 14:30:23: {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS0","driver":"NMEA0183","activated":"2020-10-12T14:30:22.966Z","flags":1,"native":0,"bps":4800,"parity":"N","stopbits":1,"cycle":1.00}]}
2020-10-12 14:30:23: {"class":"WATCH","enable":true,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
2020-10-12 14:30:23: $GPRMC,143023,A,4915.0754,N,01113.6519,E,000.0,000.0,121020,002.5,E*70
2020-10-12 14:30:23: $GPGGA,143023,4915.0754,N,01113.6519,E,1,09,1.0,401.1,M,46.4,M,,*49
2020-10-12 14:30:23: $GPGSA,A,3,02,04,05,06,07,09,16,29,30,,,,2.0,1.0,1.8*3C
2020-10-12 14:30:23: $GPGSV,3,1,09,02,39,275,38,04,25,075,33,05,26,305,30,06,33,215,32*75
2020-10-12 14:30:23: $GPGSV,3,2,09,07,65,162,33,09,64,067,41,16,18,051,33,29,05,331,20*78
2020-10-12 14:30:23: $GPGSV,3,3,09,30,38,195,33*45
as you can see all line segments start with a timestamp. Is it possible to parse such file and pick only lines that fall inside those time periods. If yes can you suggest me one two function so I can get started?

Thanks a lot.
Regards
Alex
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Copy Paste excel files based on the first letters of the file name Viento 2 349 Feb-07-2024, 12:24 PM
Last Post: Viento
  Class test : good way to split methods into several files paul18fr 4 405 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Move Files based on partial Match mohamedsalih12 2 748 Sep-20-2023, 07:38 PM
Last Post: snippsat
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,054 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  Color a table cell based on specific text Creepy 11 1,859 Jul-27-2023, 02:48 PM
Last Post: deanhystad
  Downloading time zone aware files, getting wrong files(by date))s tester_V 9 961 Jul-23-2023, 08:32 AM
Last Post: deanhystad
  splitting file into multiple files by searching for string AlphaInc 2 816 Jul-01-2023, 10:35 PM
Last Post: Pedroski55
  Making a question answering chatbot based on the files I upload into python. Joejones 1 1,153 May-19-2023, 03:09 PM
Last Post: deanhystad
  Split Bytearray into separate Files by Hex delimter lastyle 5 2,493 Mar-09-2023, 07:49 AM
Last Post: bowlofred
  Split pdf in pypdf based upon file regex standenman 1 1,976 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020