[Thread Prev][Thread Next][Index]

[ferret_users] csv header and quotes



Dear Ferretters,

I am writing a generic CSV file reading script, which takes the header
of the file to interpret this as the variable names.  Often there are
spaces and units between brackets in these headers, such as (test.csv):

v1,v2 (m),v3[nM], v4(nM)
12,123456,123456, 4
12,123456,123456, 8

let my_columns={spawn:"head -1 test.csv | sed 's/\[[^][]*\]//g' | sed 's/([^()]*)//g' | sed 's/\ //g'"}
columns/var="`my_columns`"/skip=1 test.csv

So it takes the first line of test.csv, removes two types of brackets
and the text in between and removes the spaces.  This is put in
variable my_columns, but this does not work.  When I do a (more simple
than the columns command) a say, I get:

yes? say "`my_columns`"
"!-> MESSAGE/CONTINUE "v1,v2,v3,v4

The quotes are misplaced.  What do I do wrong?

Thanks,

Marco

-- 
Koninklijk Nederlands Meteorologisch Instituut
Tel: +31 30 2206 707
Www: http://www.knmi.nl/~hulten/

LaTeX - http://genome.wustl.edu/staff/mwendl/M/white_papers/why_latex.ps


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement