3

i have so many line just like this json code (120000 lines)

{
"name":"V83.9",
"name":"Work",
"name":"V83.9",
"name":"Education",
"name":"V83.9",
"name":"Profession"
}

and i want this convert just like this

{
"name":"V83.9",
"name":"Work",
"name":"Education",
"name":"Profession"
}

and i wrote regex on vscode just like this but this is not working

Find: {\n"name":"$1",\n"name":"$2",\n"name":"$1",\n"name":"$3",\n"name":"$1",\n"name":"$4"\n}

Replace: {\n"name":"$1",\n"name":"$2",\n"name":"$3",\n"name":"$4"\n}

How do i do this?

Gama11
  • 31,714
  • 9
  • 78
  • 100
user3227899
  • 65
  • 2
  • 9
  • it's a duplicate question.. please take a look @ the below: https://stackoverflow.com/questions/37992493/how-to-remove-duplicate-lines-in-visual-studio-code – Michel Hanna Mar 04 '19 at 14:53
  • @MichelHanna then can you fix this solution? this duplicate question not fix my solution – user3227899 Mar 04 '19 at 14:57
  • 1
    Possible duplicate of [How to remove duplicate lines in Visual Studio Code?](https://stackoverflow.com/questions/37992493/how-to-remove-duplicate-lines-in-visual-studio-code) – Mark Mar 05 '19 at 02:20
  • Are lines 3 and 5 always duplicates of line 1? – Mark Mar 05 '19 at 02:25

1 Answers1

4

Please check the Transformer extension, where i have applied it on your example and it works:

Michel Hanna
  • 157
  • 1
  • 10