how do i replace number inside "id": "1",
and increment the number by +1 also remove the quotes around the number "id": 1
should look like this.
Here is an example of the json file, but it's huge. So doing this automatic by python would save alot of time
[
{
"id": "1",
"text": "How old can a sea turtle get?",
},
{
"id": "2",
"text": "How many fishes are in the lake?",
}
]
This is how far i got:
import re
with open("new 2.txt") as file:
for line in file.readlines():
x = re.findall('"id": "[a-zA-z]{0,1}[0-9]*"', line)