CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Parse text file: Edit Log



shanti.dhanus
New User

Nov 14, 2012, 12:32 AM


Views: 1510
Parse text file

Hi,

I have to parse below text file

Chassis: ch_09USE127C72T
========================
NAME : ch_09USE127C72T
HARDWARE_UNIT_TYPE : 9730
SERIAL_NUMBER : 09USE127C72T
MONITORING_HOST : x9730-node1
OVERALL_HEALTH_STATUS : DEGRADED

Servers
=======
NAME BAY
----------- ---
x9730-node1 1
x9730-node2 2

BladeEnclosure
==============
TYPE : bladeEnclosure
NAME : OA-984BE16182A9
UUID : 09USE127C72T
SERIAL_NUMBER : USE127C72T
MODEL : -
FIRMWARE_VERSION : -
STATUS : DEGRADED
LOCATION : -
PROPERTIES : -
MESSAGE : -
DIAGNOSTIC_MESSAGE : -

And it should return 3 separate arrays as below..

Array1
--------------------------------------------
Chassis: ch_09USE127C72T
========================
NAME : ch_09USE127C72T
HARDWARE_UNIT_TYPE : 9730
SERIAL_NUMBER : 09USE127C72T
MONITORING_HOST : x9730-node1
OVERALL_HEALTH_STATUS : DEGRADED

Array2
--------------------------------------------
Servers
=======
NAME BAY
----------- ---
x9730-node1 1
x9730-node2 2


Array3
--------------------------------------------
BladeEnclosure
==============
TYPE : bladeEnclosure
NAME : OA-984BE16182A9
UUID : 09USE127C72T
SERIAL_NUMBER : USE127C72T
MODEL : -
FIRMWARE_VERSION : -
STATUS : DEGRADED
LOCATION : -
PROPERTIES : -
MESSAGE : -
DIAGNOSTIC_MESSAGE : -


Please help me on this! I am very very new to perl!


(This post was edited by shanti.dhanus on Nov 14, 2012, 12:33 AM)


Edit Log:
Post edited by shanti.dhanus (New User) on Nov 14, 2012, 12:33 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives