Im using powershell or cmd to open a text file and get a specific value or text inside.
Currently the output looks like this inside the text file:
Upload Hello.zip: 0 of 933 bytes complete
Upload Hello.zip: 933 of 933 bytes complete
{
"scanId" : 11260434,
"scanType" : "Static",
"analysisStatusType" : "Pending",
"applicationName" : "Test Application Jenkins",
"releaseName" : "Release 4",
"microserviceName" : "",
"__action__" : "STARTED"
}
However, I only would like to get the value from the scan ID.
This is the command I use:
Select-String -Path C:Folderscanjson.txt ':s*(?<digits>[0-9]+)'
But It would return the output like this:
C:Folderscanjson.txt:2:Upload Hello.zip: 0 of 933 bytes complete
C:Folderscanjson.txt:4:Upload Hello.zip: 933 of 933 bytes complete
C:Folderscanjson.txt:6: "scanId" : 11260434,