Hi guys -
I'm currenlty learning mathematica; right now I'm working on learning how to output my solutions in usable formatting. I frequently would like to export to *txt or *.csv files.
Since working with Mathematica I've seen most of my outputs as lists. For usability/readibility I generally like my lists stacked as a column. Sometimes my results are lists themselves, as in the following example, from a discrete math problem:
x = 2;
l = Tuples[Range[x], x];
y = Tuples[(Range[x] /. n_ -> -n), x];
Length[l] + Length[y]
Column[{Column[l], Column[y]}]
In this example I'm interested in the number of signed permutations length x of Range 1 - x. I first output the number of permutations, then a list of all permutations. In Mathematica, it displays nicely using the column function:
However, I'd like to export it to a text file with each permutation being on a single line without the list braces. This is where I've been running into trouble.
I've tried a ReplaceAll function:
Column[{Column[l], Column[y]}] /. {{"{" -> ""}, {"}" -> ""}}
But this outputs more braces:
The other idea I had was just copy and pasting it to a text file, and do use a find-replace function there. I think what it wound up exporting was the internal representation of my data within Mathematica:
From this I'm getting the idea that the Column function doesn't convert my data to column format, but rather that it is a display command within Mathematica.
My question then is: what generic way is there for turning a list of results gotten in Mathematica into a nice stacked column format exported to a *.txt/ *.csv, without the curly braces? (I do know how to use the export command btw).
And is there a way I can write the data into a specific column (re: csv or xls exports)?
I do apologize if there's something very obvious I'm overlooking.