Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

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
share|improve this answer
    
+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 –  Xiè Jìléi Sep 15 '12 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 '12 at 8:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.