mardi 28 avril 2020

Parsing multiple .log files to get a string name

File1.log Result for scripts as follows {"Script 1"=>{"expected"=>"Pass", "actual"=>"Pass", "result"=>true},

"Script 2"=>{"expected"=>"Fail", "actual"=>"Pass", "result"=>false}

-----


Result for scripts as follows {"Script 3"=>{"expected"=>"Pass", "actual"=>"Pass", "result"=>true}, "Script 4"=>{"expected"=>"Fail", "actual"=>"Pass", "result"=>false}

File2.log Result for scripts as follows {"Script 1"=>{"expected"=>"Pass", "actual"=>"Pass", "result"=>true}, "Script 2"=>{"expected"=>"Pass", "actual"=>"Pass", "result"=>true}

I will have to parse the .log files which will contain multiple lines and get the above given lines alone.

The only thing common to be used to get this is the first text : "Result for scripts as follows" .

Any suggestions to solve this using Ruby or any powershell commandsRU

Aucun commentaire:

Enregistrer un commentaire