Question: How to export multi-dimensional data in a neat format?

I compute some properties of some graphs and try to store their edge sets and their corresponding properties. I stored them using matrices, but now I want to export them to a file (csv format).

with(GraphTheory):
graphs := [seq(RandomGraphs:-RandomGraph(8, 9), 1 .. 10)]:
M0:=Edges~(graphs):
M1:=Girth~(graphs):
M2:=Diameter~(graphs):
B := Matrix(1..3,[M0,M1,M2]);
Export("E:/B.csv", B):

 

he exported file's data is messy, and it is difficult for me to observe the corresponding properties of the graphs.  I hope they can be sorted into three columns as shown below.

PS: I know that if the data has only one column, it can be done as discussed earlier

Export("E:/M.csv", M):

To make the data appear clearer, it is best to keep suitable spacing between columns.

multi_dimensional_data.mw

Please Wait...