Completed

Script power shell to edit all filer from a folder

Hello,

I need a powershell script that can edit and replace all .json files from a folder.

Bellow, an example of a single .json file.

The script must catch the value just after the first « trait_type » .

So the value to catch in that example is « Bird ».

Then that value need to be add in the name value witch is currently « #1 »

It need do be add just before and with a blank space.

So at the end the value of name become « Bird #1 »

The original .json file.

{

"name": "#1",

"description": "my description",

"external_url": "",

"animation_url": "[login to view URL]",

"attributes": [

{

"trait_type": "Specie",

"value": "Bird"

},

{

"trait_type": "Frame",

"value": "Green Frame"

}

],

"properties": {

"files": [

{

"uri": "[login to view URL]",

"type": "video/mp4"

}

],

"creators": []

},

"compiler": "birdframe"

}

What should be the final .json file:

{

"name": "#1",

"description": "my description",

"external_url": "",

"animation_url": "[login to view URL]",

"attributes": [

{

"trait_type": "Specie",

"value": "Bird"

},

{

"trait_type": "Frame",

"value": "Green Frame"

}

],

"properties": {

"files": [

{

"uri": "[login to view URL]",

"type": "video/mp4"

}

],

"creators": []

},

"compiler": "birdframe"

}

Off course theses 2 value change in each .json file of my folder that why I need a script to catch the good value and add it etc..

Skills: Shell Script, Powershell

About the Client:
( 2 reviews ) Gradignan, France

Project ID: #34320511

Awarded to:

(97 Reviews)
5.2