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.

1 Answer 1

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
2
  • +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: goo.gl/B8hl0
    – Lenik
    Sep 15, 2012 at 7: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, 2012 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .