TIMFOX123
asked on
How do I redo an array in ruby to an array of arrays ?
My data looks like this:
<todo>
filename: call john doe_20120405_081431_
call john doe_20120405_081431_about car
call john doe_20120405_081431_about car_about offer
Update-YN:y
OpenClosed_OC:O
Status-RYG:G
<todo>
filename: till garden_20120405_081432_
till garden_20120405_081432_get gas
till garden_20120405_081432_get oil
Update-YN:N
OpenClosed_OC:O
Status-RYG:G
<todo>
The objective is to pull out the first <todo> and if "Update-YN:Y" then process just that todo. I am thinking I need to make an array from the original array splitting the elements upon <todo>. I will have many more than two elements however this is representitive data. This is a project for my learning.
My code thus far is:
@pimworking = File.open('pim_working.txt ')
puts @pimworking.readlines
thx
timfox123
<todo>
filename: call john doe_20120405_081431_
call john doe_20120405_081431_about car
call john doe_20120405_081431_about car_about offer
Update-YN:y
OpenClosed_OC:O
Status-RYG:G
<todo>
filename: till garden_20120405_081432_
till garden_20120405_081432_get
till garden_20120405_081432_get
Update-YN:N
OpenClosed_OC:O
Status-RYG:G
<todo>
The objective is to pull out the first <todo> and if "Update-YN:Y" then process just that todo. I am thinking I need to make an array from the original array splitting the elements upon <todo>. I will have many more than two elements however this is representitive data. This is a project for my learning.
My code thus far is:
@pimworking = File.open('pim_working.txt
puts @pimworking.readlines
thx
timfox123
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
welcome
ASKER
Been working on this too long
thanks !!!!
Great job