First off, hello everyone.

 

The program I'm trying to write requires me to grab a specific set of
multiline output from a command and store it in an array.  I have output
that looks like this:

 

Hosts associated with this datastore.

 ag-vmsql01-srv.agbr.com

 ag-vmsql01-srv.agbr.com

 ag-vmsql02-srv.agbr.com

 

Virtual machines on this datastore.

 ag-tsgate-srv

 ag-voicecon-srv

 ag-ts01-srv

 ag-testsql-srv

 ag-sql0501-srv

 ag-bartend-srv

 

Templates on this datastore.

 None

 

Datastore Folder Structure.

 Folder Path: '[Win_Prod_1]'

 Files present

  ag-bartend-srv

  ag-ts01-srv

  ag-voicecon-srv_1

  ag-tsgate-srv

  ag-sql0501-srv

  ag-testsql-srv

 

 Folder Path: '[Win_Prod_1] ag-bartend-srv/'

 Files present

  ag-bartend-srv-flat.vmdk

  ag-bartend-srv.nvram

  ag-bartend-srv.vmdk

  ag-bartend-srv.vmsd

  ag-bartend-srv.vmx

  ag-bartend-srv.vmxf

  vmware.log

  vmware-2.log

  vmware-3.log

  vmware-4.log

  ag-bartend-srv-c17f6d6e.vswp

  vmware-5.log

  vmware-6.log

  vmware-7.log

 

 Folder Path: '[Win_Prod_1] ag-ts01-srv/'

 Files present

  ag-ts01-srv.vmsd

  ag-ts01-srv.vmx

  ag-ts01-srv.vmxf

 

 

And I need to able to grab just one secition, like this:

 

Folder Path: '[Win_Prod_1] ag-bartend-srv/'

 Files present

  ag-bartend-srv-flat.vmdk

  ag-bartend-srv.nvram

  ag-bartend-srv.vmdk

  ag-bartend-srv.vmsd

  ag-bartend-srv.vmx

  ag-bartend-srv.vmxf

  vmware.log

  vmware-2.log

  vmware-3.log

  vmware-4.log

  ag-bartend-srv-c17f6d6e.vswp

  vmware-5.log

  vmware-6.log

  vmware-7.log

 

and make each line an entry in an array.  I do not actually need the
first two lines, but I can pop them off so grabbing them isn't a
problem.  I can get a regex to match the "Folder Path:..." line but I'm
not sure how to get the rest of the section, up to the next empty line,
into an array.  


Can anyone help?  

 

Thanks,

  

Steven Whaley

 

Systems Administrator

Associated Grocers, Inc.

225.769.2020x1426 Office

225.276.9981 Cell

 

Reply via email to