0

I have a json file that has this type of format:

{"id":61,"statement":"English is the language spoken in the largest number of countries in the world.","correct":true,"additional":null},

{"id":62,"statement":"Italy is shaped like a hat.","correct":false,"additional":"Italy is shaped like a boot."},

{"id":63,"statement":"The Cape of Good Hope is in South Africa.","correct":true,"additional":null},

{"id":65,"statement":"The largest island in the world is Hawaii.","correct":false,"additional":"Greenland is the largest island in the world that isn't considered a continent."},

It contains 6k rows of data and sometimes like in example id skips a number (63 - 65), I want to to start the first id with 1 and gradually increase by 1. How can it be achieved? I suppose regex could be of use here.

Mindaugas
  • 17
  • 3
  • Write a Python script in NPP to fix that, or better just use Python staight. – Wiktor Stribiżew Oct 06 '16 at 19:43
  • That's a quite general comment – Mindaugas Oct 06 '16 at 19:51
  • I don't have experience with python so I wouldn't know where to start :D – Mindaugas Oct 06 '16 at 19:54
  • Well, it is never late to improve your skills. Here is [my previous answer that will give you a jumpstart](http://stackoverflow.com/questions/37300462/notepad-find-replace-number-with-increment-value/37300757#37300757). You will need a regex like `r'("id"\s*:\s*)(\d+)'` and then use 2 groups in the replacement callback method. – Wiktor Stribiżew Oct 06 '16 at 19:59

0 Answers0