POSTed CSV files lose its newlines - how to use CSV-node in this case?

I receive a csv-file from the HTTP IN POST node. It is a Buffer so I use a msg.payload.toString() function.
Then I pass it into the CSV-node.


This is the original csv that is POSTed to Node-Red:


And this is the SVV debugnode:

I have "Skip first 0 lines" in the CSV-node. Because when I skip 1 line then SVV-debug is empty. So this looks like msg.payload from Payload to String results in one line and does not take into account the CR and or LF?

I am sure I lack some basic understanding. But where do I go wrong?

Thanks in advance!

Feed the output of the Payload to String node to a debug node and show us what you see,


What does the buffer look like in a debug node? Have you checked that the newline chars are there?

Hm, seems there are no newline chars in the Buffer.


This is the syntax I use for POSTing:

curl --header "Content-Type: text/csv" --request POST -d "@svv.csv" "https://endpoint....

Maybe I should have another Content-Type?

This translates to:


What is done with the newlines that are in the original file?

I think you had better edit the subject line of the thread, now we know it is nothing to do with the csv node or the parsing. As to why they are not there, I don't know.

Problem solved!

The curl-command I used to POST had a

-d file

should have been

--data-binary file

Now complete format is coming in and CSV-node handles all records correctly!


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