I need to skip the first row of a csv file, which is auto-generated by some magic measurement apparatus. It contains its own filename as the first line. The second line contains the column names (no problem) and then the data follows:
C:\someFolder\measure\....\measurement.csv
"F_1k", ....
134.56, ....
I have found the method of reading the whole file line by line and then writing every line but the first one to a temporary file, but that seems brutal. TH.'s answer to File input and output can be modified to do just that.
As far as I know, pgfplots and datatool can not skip lines of a csv file.
Manually removing the first line is not an option, I have several hundreds of these beasts. I also try to avoid external programs because the resulting code will be used on different platforms.
/pgfplots/table/skip first n={integer i}for\addplot table. Example:\addplot table[skip first n=1, ...– ComFreek Sep 04 '14 at 19:59\pgfplotstableread{data.dat}{\data};and then\addplot table[skip first n=2, x index=0, y index=1] {\data}. The skip seems to be only accepted if put at the place where the file is actually loaded. Would be nice to be able to skip for individual plot commands when using the same data file! – Christoph90 Mar 29 '16 at 10:20table[y expr={\coordindex<0 ? nan : \thisrowno{1}}]will work. It seems that doing this just for y is sufficient. I'm using<0because\coordindex, unlike\lineno, does not count comments and the header. – bgfvdu3w Feb 02 '22 at 03:37