I have these text files that are metadata, in these files, there are always (at the same position) numbers that I have to put in quotes, so just that you can undersand here is an exeample
...
{
"trait_type": "Number of lines",
"value":1
},
{
"trait_type": "Number of circles",
"value":4
},
...
So as you can see, I forgot to put these numbers between quotes.
What I was thinking about (if that's the best solution) is to store these numbers in a variable, rewrite the line but this time with the variable in quotes.
I know that I could use the file.read()
method, but what I don't understand is how can I make it read a very specific character since it reads the file from top to bottom.