Convert table from long to wide format

Given this data in long format:

Day      Meal       Food
Monday   Breakfast  Cereal
Monday   Lunch      Ham sandwich
Monday   Dinner     Tuna bake
Tuesday  Breakfast  Porridge
Tuesday  Lunch      Enchilada
Tuesday  Dinner     Spaghetti

It is possible to turn it into the equivalent wide format:

         Breakfast  Lunch         Dinner
Monday   Cereal     Ham sandwich  Tuna bake
Tuesday  Porridge   Enchilada     Spaghetti

Note how the categories in the first column of the long format have turned into row names, while the categories in the second column have turned into column names. The data displayed in the cells is the third column.

I’ve tried to use pivot tables in Libreoffice 5.0.3.2 on OS X 10.11.1, but these only allow me to display aggregate data about the dinner column such as SUM or AVG, not the data entries themselves.

What do you want to do with the two values for Tuesday-Lunch?

Sorry, there shouldn’t have been two values for Tuesday-Lunch. Edited to fix.

I guess 2 values it is a copying error (dinner expected) but I have another question: is it for one week or more?

Please take a look if this example does what you like.
If there are duplicates only the last is retrieved.

TransposePartOfTableData.ods

That does what I asked, thank you.