0

I have a json response from where I need to read only the path name and write to an output file

"path":"path1","url":"URL1"},"changeType":"edit"},{"item":{"version":138390,"size":2209,"hashValue":"CJkHrcI2FSKb3IoIGr/g/g==",
"path":"PATH2","url":"URL2"},"changeType":"edit"},{"item":{"version":138390,"size":25263,"hashValue":"OU0Rf623p47fTt4ASnSGOA=="

and I want my output file to have just PATH1 PATH2

how do i use regex to achieve this? or any other easier way to do this?

3
  • 1
    Please format your code and sample input/output properly. Commented May 25, 2020 at 2:45
  • Your Json don't seem to be valid. Commented May 25, 2020 at 4:31
  • Please edit your question and show us valid json. Commented May 25, 2020 at 7:43

1 Answer 1

1

Please format your json properly and then you may use something like this to get the path value

(Get-Content "<path of json file>" | ConvertFrom-Json).item.path
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.