I have a JSON file that looks like this:
"Algeriet" :
[
{
"name" : "Nyårsdagen",
"date" : "2013-01-01",
"ID" : "1"
},
{
"name" : "Mawlid En Nabaoui Echarif",
"date" : "2013-01-24",
"ID" : "2"
},
{
"name" : "Första maj",
"date" : "2013-05-01",
"ID" : "3"
},
...
]
Now I would like to begin incrementing the IDs from 0 instead of 1. How can I do this with Sublime Text 2? I have installed the Text Pastry plugin but I'm not sure how to select the IDs in the text so that I can replace these values.
While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy. Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.
To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line.
Solved it by doing these steps:
"ID" : "\d+"
and replacing it with a string which I know does not exist anywhere in the file (I replaced it with "ID" : "xyz"
"ID" : "xyz"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With