# CSV column name contains space

**URL:** <https://discourse.nodered.org/t/csv-column-name-contains-space/86380>\
**Category:** General\
**Created:** [12 March 2024 18:27 UTC](https://discourse.nodered.org/t/csv-column-name-contains-space/86380 "2024-03-12T18:27:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloRu](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@FloRu](https://discourse.nodered.org/u/FloRu)\
**Post date:** [12 March 2024 18:27 UTC](https://discourse.nodered.org/t/csv-column-name-contains-space/86380/1 "2024-03-12T18:27:37Z")

</div>

Today I got a CSV file out of a platform, and I need to extract the values.  
The problem is: three of the columns have space characters in their name.

Normally this is not a big problem: you could take a text editor and edit the first line of the file...  
But in this case a couple of not-so-technical-customers have to do the export of the csv files (out of a website) and should be able to upload the files to the Node-RED instance via drag & drop.

Now after the csv import node there are the three objects like  
`payload.read out`  
which I can't address inside the next function node - or do I?

Once again: thanks for your help!  
Florian

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [12 March 2024 18:35 UTC](https://discourse.nodered.org/t/csv-column-name-contains-space/86380/2 "2024-03-12T18:35:05Z")

</div>

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

This path will show the correct format for properties with spaces or special characters  
eg. `payload["path with spaces"]`

You then add `msg.` to the front of path to use in a function node. [Property accessors - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors)

You can also give the properties names in the csv node by adding a column list in the column field.  
e.g `property1,property2,property3,etc`

---

<div class="post-metadata">

**Author:** ![FloRu](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@FloRu](https://discourse.nodered.org/u/FloRu)\
**Post date:** [12 March 2024 18:40 UTC](https://discourse.nodered.org/t/csv-column-name-contains-space/86380/3 "2024-03-12T18:40:57Z")

</div>

YES! That's great!

I think I forgot to try the easiest thing which was located right in front of my nose... 😅

That's why I love to use Node-RED: because of people like you who are not getting tired of helping people like me, even if the solution is that easy and straight-forward like this one.

Thanks a lot, E1cid!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 March 2024 18:40 UTC](https://discourse.nodered.org/t/csv-column-name-contains-space/86380/4 "2024-03-26T18:40:59Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
