Consider the following scenario where an object is structured as shown below:
data {
second minute hour
dog cat horse
apple orange strawberry
}
Is there a way to iterate through the fields{} dictionary and convert each line into its individual array or list? The desired output format is demonstrated as follows:
data {
[one: second, two: minute, three: hour]
[one: dog, two: cat, three: horse]
[one: apple, two: orange, three: strawberry]
}
Any thoughts on how this transformation can be achieved?