csvsimple csvreader는 옵션 구분 기호를 사용하지 않습니다.

csvsimple csvreader는 옵션 구분 기호를 사용하지 않습니다.

내 CSV는 탭으로 구분됩니다.

\csvautotabular옵션을 사용하여 로드하면 separator=tab제대로 작동합니다. 그러나 문서의 예와 같이 로드하면 \csvreader첫 번째 데이터 줄만 인쇄됩니다.

출력을 볼 수 있는 사진은 마지막에 첨부됩니다.

탭이 있는 내 파일(table-data/parse_size_out.tsv):

benchmark   num_post_packed_blocks  num_clb
ch_intrinsics.v 295 65
diffeq1.v   299 36
diffeq2.v   198 29
mkPktMerge.v    509 27
raygentop.v 634 106
stereovision3.v 54  13

쉼표로 다시 형식화했습니다(table-data/parse_size_out_commas.csv).

benchmark,num_post_packed_blocks,num_clb
ch_intrinsics.v,295,65
diffeq1.v,299,36
diffeq2.v,198,29
mkPktMerge.v,509,27
raygentop.v,634,106
stereovision3.v,54,13

MWE:

\documentclass{article}

\usepackage{csvsimple}

\begin{document}

\csvautotabular[
separator=tab,
respect underscore=true
]{table-data/parse_size_out.tsv}

\vspace{1cm}

\begin{tabular}{|l|c|}\hline%
\bfseries Benchmark & \bfseries \#blocks
\csvreader[
separator=tab,
respect underscore=true,
head to column names
]{table-data/parse_size_out.tsv}{benchmark=\benchmark,num_post_packed_blocks=\numblocks}{%
\\\benchmark & \numblocks
}%
\\\hline
\end{tabular}

\vspace{1cm}

\begin{tabular}{|l|c|}\hline%
\bfseries Benchmark & \bfseries \#blocks
\csvreader[
respect underscore=true,
head to column names
]{table-data/parse_size_out_commas.csv}{benchmark=\benchmark,num_post_packed_blocks=\numblocks}{%
\\\benchmark & \numblocks
}%
\\\hline
\end{tabular}

\end{document}

\csvautotabular:

csvautotabular

\csvreader탭 파일 포함:

탭이 있는 csvreader

\csvreader쉼표가 있는 파일:

쉼표가 있는 csvreader

답변1

(유지관리되는) 버전을 로드해야 합니다 l3.

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage[l3]{csvsimple}

\begin{document}

\csvautotabular[
  separator=tab,
  respect underscore=true
]{a.tsv}

\vspace{1cm}

\begin{tabular}{|l|c|}\hline
\bfseries Benchmark & \bfseries \#blocks
\csvreader[
  separator=tab,
  respect underscore=true,
  head to column names
]{a.tsv}{benchmark=\benchmark,num_post_packed_blocks=\numblocks}{%
  \\\benchmark & \numblocks
}
\\\hline
\end{tabular}

\vspace{1cm}

\begin{tabular}{|l|c|}\hline
\bfseries Benchmark & \bfseries \#blocks
\csvreader[
  respect underscore=true,
  head to column names
]{b.csv}{benchmark=\benchmark,num_post_packed_blocks=\numblocks}{%
  \\\benchmark & \numblocks
}
\\\hline
\end{tabular}

\end{document}

(파일명을 변경했다가 다시 편집했습니다.)

여기에 이미지 설명을 입력하세요

관련 정보