Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete duplicate multiple lines using vscode

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?

like image 974
user3227899 Avatar asked Dec 01 '25 02:12

user3227899


1 Answers

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

like image 92
Michel Hanna Avatar answered Dec 04 '25 23:12

Michel Hanna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!