Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read this properly?
#1
I have a reallly huge file like
TXT FILE:
Output:
{"PseudorangeRateUncertaintyMetersPerSecond": 0.1289496429081, "DriftUncertaintyNanosPerSecond": "", "AccumulatedDeltaRangeState": 1, "ReceivedSvTimeNanos": 491721930367520.0, "TimeUncertaintyNanos": "", "SnrInDb": "", "FullBiasNanos": -1.2125108815424e+18, "State": 47, "MultipathIndicator": "0", "AgcDb": "", "PseudorangeRateMetersPerSecond": -80.016064827732, "TimeNanos": 40458000000, "Svid": 10, "AccumulatedDeltaRangeUncertaintyMeters": 0.002334289252758, "AccumulatedDeltaRangeMeters": -3022.5235041815, "BiasUncertaintyNanos": 5.3149323606571, "BiasNanos": 0, "CarrierPhaseUncertainty": "", "CarrierFrequencyHz2": "\n", "TimeOffsetNanos": 0, "DriftNanosPerSecond": "", "CarrierFrequencyHz": "", "ConstellationType": "1", "CarrierCycles": "", "ReceivedSvTimeUncertaintyNanos": 25, "CarrierPhase": "", "LeapSecond": "", "HardwareClockDiscontinuityCount": 0, "ElapsedRealtimeMillis": 14068886, "Id": "Raw", "Cn0DbHz": 31.292695999146} {"GPS_time": "2018-06-08 16:35:24", "Altitude": 70.768542, "Longitude": -0.337611, "Provider": "gps", "Latitude": 39.479199, "Speed": 0, "Id": "Fix", "Accuracy": 4} {"Number_of_sentences_for_full_data": 4, "Elevation_Degrees": 14, "Azimuth_degrees": 62, "Sentence_1_of_2": 3, "Number_of_satellites_in_view": 14, "Satellite_PRN_number": 21, "SNR": "33", "CheckSum_data": 7, "Satellites_in_view": "$GPGSV", "Id": "NMEA GSV"} {"Latitud": 3928.752338, "HorizontalDilutionofPosition": 0.4, "TimeinSecondsSinceLastDGPSUpdate": "51.1", "Direccion_longitud": "W", "GlobalPositioningSystemFixData": "$GPGGA", "Direccion_Latitud": "N", "FixQuality": 1, "DGPSStationIDNumber": "51.1", "Altitude": 19.6, "Geoid_height_units": "M", "ChecksumData": "M", "Fixtakenat_hh_mm_ss_UTC": 163508, "NumberofSatellitesTracked": 30, "Geoid_height": 51.1, "Altitude_units": "M", "Id": "NMEA GGA", "Longitud": 20.256369}
And i need it to make each {___,_____,_____,} a single line,
how can i make that?
Reply
#2
It looks like json, but not well formed.
You can split at }{

EDIT: after adding output tags, it looks like each of these is separate line in the file. so why not just read it line by line?
Could you provide actual file to get better understanding of the format?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Forum Jump:

User Panel Messages

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