easiest way to convert virtualbox snapshots to tree view

Posted by amir beygi on Stack Overflow See other posts from Stack Overflow or by amir beygi
Published on 2010-05-07T04:27:04Z Indexed on 2010/05/07 4:28 UTC
Read the original article Hit count: 402

HI all My virtual box snapshot view is like this

   Name: Snapshot 2 (UUID: cb45aef4-54d4-4c4e-ad3e-dd7cccb6103a)
      Name: s131 (UUID: 8ec30c82-7796-4e51-8161-979f1b95fb0f)
         Name: s131 (UUID: 42066f33-969b-41f3-a779-7f6e2c45ea2c)
            Name: s131 (UUID: d71b9bc5-b862-46b5-ae4d-f88d3dd9756d)
               Name: s131 (UUID: 681896a9-7e61-4b5a-90bc-cb1bd785c6fc)
                  Name: s131 (UUID: d7bf8593-d218-442d-b23b-4ee16e74087d)
                     Name: s131 (UUID: e8b16fd2-7add-4294-b908-34c4e6dc79dc)
                        Name: s131 (UUID: 57c3f5d7-d4ed-4a62-a7b8-5594f819e08e)
               Name: Snapshot 3 (UUID: 4a684149-9dd6-4bb2-baf5-5f590e91a344)
                  Name: Snapshot 4 (UUID: d4cbaa7c-ae78-41e0-9962-46c587a9c667)
                     Name: Snapshot 5 (UUID: 81567b6e-eea9-49a6-b3b8-a07f0be337d8) *

and i want to convert this text to a tree like this

   Name: Snapshot 2 (UUID: cb45aef4-54d4-4c4e-ad3e-dd7cccb6103a)
   +--Name: s131 (UUID: 8ec30c82-7796-4e51-8161-979f1b95fb0f)
      +--Name: s131 (UUID: 42066f33-969b-41f3-a779-7f6e2c45ea2c)
         +--Name: s131 (UUID: d71b9bc5-b862-46b5-ae4d-f88d3dd9756d)
            +--Name: s131 (UUID: 681896a9-7e61-4b5a-90bc-cb1bd785c6fc)
            |  +--Name: s131 (UUID: d7bf8593-d218-442d-b23b-4ee16e74087d)
            |     +--Name: s131 (UUID: e8b16fd2-7add-4294-b908-34c4e6dc79dc)
            |        +--Name: s131 (UUID: 57c3f5d7-d4ed-4a62-a7b8-5594f819e08e)
            +--Name: Snapshot 3 (UUID: 4a684149-9dd6-4bb2-baf5-5f590e91a344)
               +--Name: Snapshot 4 (UUID: d4cbaa7c-ae78-41e0-9962-46c587a9c667)
                  +--Name: Snapshot 5 (UUID: 81567b6e-eea9-49a6-b3b8-a07f0be337d8) *

or even an array that contents line number and parent's line number.

My environment is linux, programming language is C, and i got this results from this shell command

VBoxManage snapshot s2000 showvminfo s|grep Name|grep UUID 

© Stack Overflow or respective owner

Related posts about virtualbox

Related posts about linux