10

I want to use | as column separator in the CSV file. Because it looks clean, so I won't feel headache to edit the CSV file directly.

I have checked the manual, it seems the option col sep accepts only a few values: comma for ,, semicolon for ;, colon for :, braces for {}, ampersand for &, space and tab. That's all.

I have tried col sep=| however it won't work.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Lenik
  • 1,075

1 Answers1

8

Looking at the code, the separator choices are hard-coded (they set an internal switch, which then selects different auxiliaries). You should be able to read the table described using datatool, or could make a feature request for pgfplots.

To do things 'by hand' I think you need

\documentclass{article}
\usepackage{pgfplots}
\makeatletter
\let\pgfplotstableread@impl@ITERATE@NEXT\pgfplotstableread@impl@ITERATE@NEXT@PIPE
\long\def\pgfplotstableread@impl@DO@#1{%
  \pgfplotstableread@impl@ITERATE#1|\pgfplotstable@EOI}%
\long\def\pgfplotstableread@impl@ITERATE@NEXT@PIPE#1|{%
    \pgfplotstableread@impl@ITERATE@NEXT@{#1}%
    \pgfplotstableread@impl@ITERATE
}
\makeatother
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • +1 for the magical code. It's just not compiled: \long\def\pgfplotstableread@impl@DO@##: ! Parameters must be numbered consecutively.. I've made the feature request: http://goo.gl/B8hl0 – Lenik Sep 15 '12 at 07:58
  • @XièJìléi I've corrected that: I took some code from pgfplots and forget it was in a nested definition. – Joseph Wright Sep 15 '12 at 08:03