C
CBlair1986
Hi. What I'd like to do is to take a file like so:
---
Apple
Color: Red
Peel: Yes
Has Core: Yes
Orange
Color: Orange
Peel: Yes
Has Core: No
---
and go through it, line by line, assigning the 'Apple' and 'Orange'
lines to a name attribute on different hashes, and then using the name
before the colons such as 'Color' and 'Peel' as keys for the respective
values.
I'm just asking for a bit of help and guidance, as I'm still not very
keen on using regular expressions that comfortably and all.
Thanks to anyone who helps!
---
Apple
Color: Red
Peel: Yes
Has Core: Yes
Orange
Color: Orange
Peel: Yes
Has Core: No
---
and go through it, line by line, assigning the 'Apple' and 'Orange'
lines to a name attribute on different hashes, and then using the name
before the colons such as 'Color' and 'Peel' as keys for the respective
values.
I'm just asking for a bit of help and guidance, as I'm still not very
keen on using regular expressions that comfortably and all.
Thanks to anyone who helps!