CSV column name contains space

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

Thereā€™s a great page in the docs (Working with messages : Node-RED) 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

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

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

YES! That's great!

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

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!

1 Like

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