Der folgende Code ermöglicht, zeilenweise Auszüge aus Tabellen als neue Tabelle zu erstellen. Die Kommentare (comment) sollen in der Auszugstabelle erscheinen, aber nicht in den Ursprungstabellen.

Open in writeLaTeX
Code, hier editierbar zum Übersetzen:
\documentclass[a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\newcommand{\extract}[1]{#1\immediate\write\extracttable{Tabelle \thetable\noexpand& #1\noexpand\\}}
\begin{document}
\newwrite\extracttable
\def\mytable{mytable}
\immediate\openout\extracttable=\mytable.ext
\begin{longtable}{p{1cm}p{1cm}p{1cm}}\caption{Erste}\\
\extract{ATest&ATest&comment}\\
BTest&BTest&comment\\
\extract{CTest&CTest&comment}\\
\extract{DTest&DTest&comment}\\
\end{longtable}
\begin{longtable}{p{1cm}p{1cm}p{1cm}}\caption{Zweite}\\
\extract{VTest&VTest&comment}\\
WTest&WTest&comment\\
\extract{XTest&XTest&comment}\\
\extract{YTest&YTest&comment}\\
\end{longtable}
\immediate\closeout\extracttable
\begin{longtable}{p{3cm}p{2cm}p{2cm}p{2cm}}\caption{Extract Erste \& Zweite}\\
\textbf{fromtable}& \textbf{value}& \textbf{value}&\textbf{comment}\\\endfirsthead \textbf{table}& \textbf{value}& \textbf{val}&comment\\\endhead
\input \mytable.ext
\end{longtable}
\end{document}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gefragt 20 Okt '14, 01:41

ctansearch's gravatar image

ctansearch
(ausgesetzt)
Akzeptiert-Rate: 18%

bearbeitet 20 Okt '14, 01:43


Open in writeLaTeX
Code, hier editierbar zum Übersetzen:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\newwrite\extracttable
\immediate\openout\extracttable=extract.ext
\newcommand{\extracttables}{
\begin{longtable}[l]{p{3cm}p{2cm}p{2cm}p{2cm}}\caption{Extract}\\
\textbf{fromtable}& \textbf{value}&
\textbf{value}&\textbf{comment}\\\endfirsthead \textbf{table}&
\textbf{value}& \textbf{val}&comment\\\endhead
\immediate\closeout\extracttable
\input extract.ext
\end{longtable}}
\newcommand{\extract}[2]{#1 \immediate\write\extracttable{Tabelle \thetable \noexpand&#1\noexpand&#2\noexpand\\}}
\begin{document}
\begin{longtable}[l]{p{1cm}p{1cm}p{1cm}}\caption{Erste}\\
\extract{ATest&ATest}{comment}\\
BTest&BTest\\
\extract{CTest&CTest}{comment}\\
\extract{DTest&DTest}{comment}\\
\end{longtable}
\begin{longtable}[l]{p{1cm}p{1cm}p{1cm}}\caption{Zweite}\\
\extract{VTest&VTest}{}\\
WTest&WTest\\
\extract{XTest&XTest}{}\\
\extract{YTest&YTest}{}\\
\end{longtable}
\extracttables
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Permanenter link

beantwortet 20 Okt '14, 22:39

ctansearch's gravatar image

ctansearch
(ausgesetzt)
Akzeptiert-Rate: 18%

Deine Antwort
[Vorschau ausblenden]

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Frage-Themen:

×257
×7
×1

gestellte Frage: 20 Okt '14, 01:41

Frage wurde gesehen: 6,530 Mal

zuletzt geändert: 20 Okt '14, 22:39

Willkommen, erstes Mal hier? Schau mal unter FAQ!

×