1
$\begingroup$

I have data that I want to export to a text file.

s = Subsets[{a, b, c}];
r = Table[s[i]] + 1, {i, Length[s]}];
Export["file.TXT", {r, s}, "Table"]
{}    {1 + a} {1 + b} {1 + c} {1 + a, 1 + b}  {1 + a, 1 + c}  {1 + b, 1 + c}  {1 + a, 1 + b, 1 + c}
{}    {a} {b} {c} {a, b}  {a, c}  {b, c}  {a, b, c}

But I need to Export data vertically.

enter image description here

$\endgroup$
2
  • $\begingroup$ Maybe Export["file.TXT", Transpose[{r, s}], "Table"]? $\endgroup$ Commented Jan 20, 2024 at 19:25
  • 1
    $\begingroup$ If I correctly understand your question, you want to add 1 to every element.This can be done by: Map[# + 1 &, s, {2}] $\endgroup$ Commented Jan 20, 2024 at 19:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.