[Tex/LaTex] Is it possible to exchange rows and columns of a table without retyping

tables

I wrote a table that turned out to be too wide. So I have to turn it sideways for it to fit a typical journal paper. Is there a way I can avoid typing it all over again?!

Like John Kormylo said, pgfplotstable can be a convenient way to do this.

\documentclass{article}
\usepackage{booktabs}
\usepackage{pgfplotstable}

\begin{document}

{Header 1}   A   B   C   D   E
{Header 2}   1   2   3   4   5
{Header 3}  10   11   12   13   14
}\tablesource

\pgfplotstabletranspose[string type,
]\tabletransp{\tablesource}

\begin{center}
Table Source:

\pgfplotstabletypeset[string type,
every last row/.style={after row=\bottomrule},
after row=\midrule
]{\tablesource}
\vspace{8mm}

Table transpose:

\pgfplotstabletypeset[string type,
every last row/.style={after row=\bottomrule},
after row=\midrule
]{\tabletransp}
\end{center}

\end{document}


I'm not a expert, but in my test's I understand that's need to stay alert about spaces.

In \pgfplotstableread you will enter you source table. Into the final of this command, you will name this source; in this case is \tablesource.

In \pgfplotstabletranspose you will finish with tha name of transposed table; \tabletransp.

The command \pgfplotstabletypeset will call what you put into brackets.