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


Messages In This Thread
Split gps files based on time (text splitting) - by dervast - Nov-09-2020, 09:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Change Text Size in Console? CodingKid 1 91 Jul-20-2021, 02:47 PM
Last Post: deanhystad
  Several pdf files to text mfernandes 10 505 Jul-07-2021, 11:39 PM
Last Post: Pedroski55
  Open and read multiple text files and match words kozaizsvemira 3 3,782 Jul-07-2021, 11:27 AM
Last Post: Larz60+
  Reading Multiple text Files in pyhton Fatim 1 254 Jun-25-2021, 01:37 PM
Last Post: deanhystad
  Matching two files based on a spited elements tester_V 5 400 May-30-2021, 07:49 PM
Last Post: tester_V
  More elegant way to remove time from text lines. Pedroski55 6 943 Apr-25-2021, 03:18 PM
Last Post: perfringo
  A text-based game [SOLVED] Gameri1 6 775 Apr-20-2021, 02:26 PM
Last Post: buran
  Increment text files output and limit contains Kaminsky 1 551 Jan-30-2021, 06:58 PM
Last Post: bowlofred
  Update Date based on Time/String stevezemlicka 1 457 Jan-08-2021, 06:54 PM
Last Post: Gribouillis
  [split] How to convert the CSV text file into a txt file Pinto94 5 674 Dec-23-2020, 08:04 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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