tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/5390-extract-column-headers-from-a-csv-fileNodeBox: Discussion 2015-02-25T07:56:57Ztag:support.nodebox.net,2012-11-01:Comment/359910852015-02-10T19:41:14Z2015-02-10T19:41:14ZExtract Column Headers from a CSV file?<div><p>In NB3 there is no direct way of getting this. I agree it should
be possible. The only way at the moment is cheating by adding a row
in your csv file: repeating the headers. Later on you have to omit
these rows. I agree this is not a real solution. We'll look into
this and see if this can not be handled in the next release.</p>
<p>regards,</p>
<p>Lucas</p></div>lucasnijstag:support.nodebox.net,2012-11-01:Comment/359910852015-02-10T23:46:46Z2015-02-10T23:46:46ZExtract Column Headers from a CSV file?<div><p>Thanks for the response, Lucas.</p>
<p>If you are compiling a wish list I have another related feature
request.</p>
<p>It would be very handy to create a two dimensional zip map that
would let me create and pass internal CSV data structures from node
to node. As far as I can tell, the current zip map can only create
a vector of label-value pairs, not a matrix with multiple index
rows.</p>
<p>The output of this improved zip map node would be a data
structure just like the output of import CSV. Other nodes could
then filter this output and do look ups on it. This would be a very
powerful and useful capability.</p>
<p>Doesn't hurt to ask.</p>
<p>Thanks again,</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/359910852015-02-11T15:40:13Z2015-02-11T15:40:13ZExtract Column Headers from a CSV file?<div><p>Hello John,</p>
<p>don't forget you can add your own code libraries. Enclosed is a
file with a custom node that gets the headers as you want. Then you
can count them too if you want...<br>
Have fun,</p>
<p>Lucas<br>
PS: the csvheaders.py needs to be at the same root.</p></div>lucasnijstag:support.nodebox.net,2012-11-01:Comment/359910852015-02-12T02:06:45Z2015-02-12T02:06:45ZExtract Column Headers from a CSV file?<div><p>Nice! Thanks, Lucas.</p>
<p>I was aware of the ability to add my own code libraries, but
have been trying to resist it while I'm learning how to think in
NodeBox. I find that staying within the standard nodes forces me to
explore them more deeply. At first it often looks like something
can't be done, but when you look a little deeper there is usually a
way.</p>
<p>But it's impressive how simple it was to add that custom node.
Only six short lines of code. I'll keep this in mind next time I
get stuck.</p>
<p>Thanks again!</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/359910852015-02-12T06:43:36Z2015-02-12T06:43:36ZExtract Column Headers from a CSV file?<div><p>In the next release there will be a getCSVHeaders node.</p></div>Stefan Gabrielstag:support.nodebox.net,2012-11-01:Comment/359910852015-02-17T11:19:08Z2015-02-17T11:19:08ZExtract Column Headers from a CSV file?<div><p>Hi,</p>
<p>The new release, 3.0.43, contains the functionality you need.
However, the node is called "keys", since it can retrieve the keys
of any kind of map-related data, including CSV nodes.</p>
<p>Another useful feature is that you can append it after a graphic
object, in which case it will list the properties of that object
that you can retrieve using the lookup node.</p>
<p><a href=
"https://www.nodebox.net/download/">https://www.nodebox.net/download/</a></p>
<p>Best,</p>
<p>F</p></div>Frederik De Bleser