From: Nuby Ruby Date: 2007-08-29T14:37:26+09:00 Subject: Help parsing simple structured data. ------=_Part_123_9926300.1188365844828 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm rather new to Ruby and am trying to figure out how to parse some structured data.. This is pretty much the most common problem I run into and it'd be *really* helpful to see an example to wrap my head around blocks & hashes The data I'm working with is the output of `df -h` which looks like this : Filesystem Size Used Avail Use% Mounted on /dev/md0 9.9G 1.6G 7.8G 17% / /dev/md1 60G 154M 57G 1% /data /dev/sda1 99M 12M 83M 13% /boot In the end what I'd like to end up with is to be able to say print hash[md0(size)] and have it return 9.9G or hash[sda1(Mount)] and have it show the mountpoint of /boot If anyone could help I'd really appreciate it. Craig ------=_Part_123_9926300.1188365844828--