Forum Discussion

Johnn200's avatar
Johnn200
Copper Contributor
Dec 17, 2020

How I can separately data in 1 column from a csv file to others columns with header ?

Dear supporter,

 

Thank you for your visit, I'm a very new with Powershell data array, I have a question and I hope you can help me:

 

I have a .csv file with 3 column, "Auditdata" is one of them and it contains too much data and I can't filter them. its data in format "Header":"data" 

 

Can you help me a solution to spit those data to others column with header please ? also if we not spit the data, is there any way we can select one of them, like example I just want to get "ResourceTitle" data only in column "Auditdata" ?

 

 

Here is data sample:

AuditData

{"ResourceUrl":"https://www.abc.com","ResourceTitle":"How to grow up 1","EntityPath":"/api/v","OperationDetails":"{\"Name\":\"How to grow up 1\"PrivacyMode\":\"private\"}","ClientApplicationId":"cf53fce8-def6-4ae","ObjectId":"https://www.microsoftstream.com/"}

 

 

 

Appreciated your help.

John

  • Hello Johnn200,

    It looks like your AuditData is in Json notation.

    Please try to use ConvertFrom-Json

    Simply pipe your AuditData to ConvertFrom-Json and then you will be able to filter it easily.

     

    Hope that helps.

  • AndySvints's avatar
    AndySvints
    Steel Contributor

    Hello Johnn200,

    It looks like your AuditData is in Json notation.

    Please try to use ConvertFrom-Json

    Simply pipe your AuditData to ConvertFrom-Json and then you will be able to filter it easily.

     

    Hope that helps.

    • Johnn200's avatar
      Johnn200
      Copper Contributor
      Perfect comment Andy. Thank you very much

      I'm now can work with those data now. Learned new thing today.

      Thank you.

Resources