Considering this type of Json structure :
[
{
"id": "0000000000001",
"en-US": "String 1"
},
{
"id": "0000000000002",
"en-US": "String 2"
}
...
]
I want to get this structure:
[
{
"id": "0000000000001",
"en-US": "String 1",
"en-GB": "String 1",
"fr-FR": "String 1"
},
{
"id": "0000000000002",
"en-US": "String 2",
"en-GB": "String 2",
"fr-FR": "String 2"
}
...
]
Right now I am able to duplicate the lines with:
:g/en-US/t.
[
{
"id": "0000000000001",
"en-US": "String 1",
"en-US": "String 1"
},
{
"id": "0000000000002",
"en-US": "String 2",
"en-US": "String 2"
}
...
]
I tried to concatenate that with sed to replace the string used as regex (en-US) for one of the goals without getting it worked.
How could I do the duplicate and replace together?