lundi 30 mars 2015

hash from multilines strings

I have two lines of this type as output of a cli command:



Source | Status | Enable | IP address | Subnet mask
----------------------------------------------------------------------------
Static | Disabled | true | 2.2.2.2 | 255.255.0.0


I would like create a hash :



{"Source"=>"Static", "Status"=>"Disabled", "Enable"=>"true", "IP
address "=>"2.2.2.2", "Subnet mask"=>"255.255.0.0" }


Thank you


Aucun commentaire:

Enregistrer un commentaire