0

I have a json file which contains records as below

  "data": [{
      "Country": "China",
      "ShipCountry": "CN"
    },
    {
      "Country": "Indonesia",
      "ShipCountry": "ID"
    },
    {      
      "Country": "Argentina",
      "ShipCountry": "AR"
    }
  ]

I need to replace all the occurrences of value next to Country "Country": "China" ie value China inside " " should be replaced with something else

Can someone help me figure out a regex to resolve this using the notepad ++

Dinesh
  • 639
  • 1
  • 6
  • 21
  • This question would be better off at https://superuser.com/ – Eric Wu Oct 17 '19 at 17:15
  • 2
    Also, why wouldn't a simple Replace of "China" (in simple text) work? – Eric Wu Oct 17 '19 at 17:16
  • 1
    Why do you need regex? Find: `"Country": "China"`. Replace With: `"Country": "New country"`. Don't forget to do the same for `"ShipCountry": "CN"`. – MonkeyZeus Oct 17 '19 at 17:47
  • Economic sanctions? – Adassko Oct 17 '19 at 17:48
  • As you can see the value for country field is different for each record, I have only shown a sample of the data, there are many records in the original. So a simple replace won't do what I needed to be done. – Dinesh Oct 17 '19 at 17:57
  • 1
    Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Oct 17 '19 at 17:58
  • `"Country": "New country"` would work if the value for country field is the same for each and every record, but that is not the case – Dinesh Oct 17 '19 at 17:58

0 Answers0