Ok I have a basic understanding of Multi-dimensional arrays and Associative array but im totally lost on if this is possible. I need to take a log file that is somewhat delimited and read it into an array. here is an example of the text file. The groups are separated by a blank line in the log and each heading/value is separated by a ; on seperate lines the heading is on one the value is on the next line.
System Summary
Host Name;System Location;Life Cycle Controller
PHLENEL;Please set the value;[N/A]
Chassis Model;Chassis Service Tag;Chassis Lock;Chassis Asset Tag
PowerEdge R200;4TFJ5H1;Present;
Processor Brand;Processor Version;Voltage
Intel® Xeon® CPU X3350 @ 2.66GHz;Model 23 Stepping 7;1400 mV
Total Installed Capacity;Memory Available to the OS;Total Maximum Capacity;Memory Array Count
4096 MB;4032 MB;8192 MB;1
Location;Use;Installed Capacity;Maximum Capacity;Slots Available;Slots Used;ECC Type
System Board or Motherboard;System Memory;4096 MB;8192 MB;4;4;Multibit ECC
What I want is a way to read the log into an array that looks basically like this
Array
(
[0] => Array
(
[Host Name] => PHLENEL
[System Location] => Please set the value
[Life Cycle Controller] => [N/A]
)
[1] => Array
(
[Chassis Model] => PowerEdg R200
[Chassis service Tag] => 4TFJ5H1
[Chassis Lock] => Present
[Chassis Asset Tag] => NULL
)
[2] => Array
(
[Processor Brand] => Intel® Xeon® CPU X3350 @ 2.66GHz
[Processor Version] => Model 23 Stepping 7
[Voltage] => 1400mV
)
And continue on like that for the rest of the log file. My main issue is how to read that log file into that array setup. Any help on this would be great or even an idea of what might have to be done so I have a good starting place to look at.