Data Backup JSON Files Improperly Formatted

I'm trying to read the data backup files but am getting errors parsing the "timelog" data in tasks.json if someone used quotes in their comment and it's quite problematic.

Example timelog comment: 

Worked on "thing"

 

JSON file shows:

"timelog": [
            {
                "author": "vSk2ZXxiICY9",
                "dateCreated": "2022-04-25 12:00:00",
                "hours": 0.5,
                "trackComment": "Worked on "thing""
          }
]

While the file extension is "json", this is not json data and it's proving very difficult to resolve with double quotes used both as key/value identifiers AND within comment strings.. The comment parenthesis should be switched to single quotes or simply removed.

Votar a favor 0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
3 comentários
Avatar
Juan

Hi Greg Collins, thank you for bringing this to us. I have opened a ticket with our Support Team on your behalf, one of our agents will reach out to you very soon to assist you with your case 👍
 
0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Okay, I have some updates.. @... submitted a ticket and Vadim reached out after testing the data exporting.. It seems that the json file is in fact properly formatted - my mistake.

Quotations entered in comments are written as:

"timelog":[
 {

"author":"ZCGB7Juf3qIz",

"dateCreated":"2023-06-16 11:25:53",

"hours":0.16666667,

"trackComment":"this is a test comment in timelogs \"test\""

}

]

 

Note the escape characters before the quotes inside the string. Correct for json format; however, Python has some nuances when reading these.

For those doing something similar and end up here, search "json.load misses escape before quotes in json file site:stackoverflow.com" and you'll find some discussions on how to follow some extra steps when reading the json file to get timelog as a properly formatted (per Python) list of dicts. Or check here, here, here.

 

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Thanks a lot for sharing the solution with the Community Greg Collins 🤗

Lisa Community Team at Wrike Wrike Product Manager Torne-se um especialista em Wrike com o Wrike Discover

Lisa Wrike Team member Torne-se um especialista em Wrike com o Wrike Discover

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: Data Backup JSON Files Improperly Formatted
[this list is visible for admins and agents only]

Topo

Próximas sessões ao vivo

Não encontrou o que estava procurando? Escreva um novo post