Text Parser error with basic CSV

Hi everyone,

GOAL: I am trying to upload this CSV file to the CSV Parser: UploadToServer.csv

Set Up
I have a very basic set up, I am sending a CSV file from a FileMaker server to Make via a
mailhook.

The test file has 12 rows and only two records:

I keep getting an error: Number of columns on line 0 does not match header:

I am totally stuck. I have tried using toString() around the attachment name, I took a look and the encoding, but I can’t find anything wrong with the CSV file. Any suggestions are appreciated!

Welcome to the Make community!

Your CSV does not have correct line terminators.

So, in your CSV data field, paste this:

{{ replace(toString(1.data); "/[\r\n]+/g"; newline) }}

Replace Data with your webhook attachment variable.

Screenshot_2024-04-11_183206

Output:

4 Likes

Thank you very much @samliew ! You are correct and your solution works. After some research, I learned that when FileMaker exports as CSV it uses a carriage return at the end, but the CSV Parser is looking for a linefeed. Thanks again!

3 Likes

There are three types of line terminators, CRLF, LF, and CR.

  • CR: Carriage Return (also known as \r)
  • LF: Line Feed (also known as \n)
  • CRLF is just both together: \r\n

You can check with FileMaker to see if the line terminators can be customised to use “LF”.

3 Likes

@samliew I have a similar problem as Fred_S.
I also import a .csv from a HTTP request and parse it through a Text parser to remove the first 2 lines of the .csv.
Im also this error: Number of columns on line 1 does not match header.
The output is also just 1 Bundle.
Tried to use the code you provided to see if that is the issue, but no change. Are you able to help me please?

Welcome to the Make community!

That looks like a new question, could you please create a separate topic for this?

While it’s tempting to continue an existing thread, a more effective approach would be to start a new topic. It helps other community users to respond to your query, and keeps our space organised for everyone. If you start a new conversation you are also more likely to get help from other users. You can refer others back to a related topic by including that link in your question. Thank you for understanding and keeping our community neat and tidy.

The “New Topic” link can be found in the top-right of the header:
Screenshot_2023-12-19_091207

samliewrequest private consultation

1 Like

Thanks.
Done.
Maybe you can pitch in.
Thanks