Windows Style Line Endings for Binary files

Hello N8N community!

I generate some files with N8N to import into one of our systems. But before doing so I need to convert the line endings of the binary files to Windows style format (CR+LF) with Notepad++ or something similar. N8N generates UNIX stlye formated files (LF only).

How can I do this inside N8N? I managed to get the encoding of the files fixed to get the in wondows1251 (yes I know our system is pretty outdated in that regard) encoding with n8n-nodes-text-manipulation - npm community package.

Cheers

Hi @vuchl, I don’t think any of the default n8n nodes let’s you currently specify the line ending unfortunately. Could you perhaps consider writing your file through the echo command in the Execute Command node? This way, the OS would handle the line breaks.

Hey man!

I thought about using awk or something to substitute the line endings. I run on docker so it’s a *nix system that writes LF.

I got in touch with the developer of the community node and he is looking into getting something done there.

Will report back.

1 Like

Sounds like a dos2unix / unix2dos style command is needed :thinking:

Yeah this could also be a good way to solve it without being reliant on a community node for folks that don’t trust or can’t use those.

@vuchl
One thing from the author of the text-manipulation node:

Most nodes are open source. So you can also look at the source code if you don’t trust the author :).

My node now also allows special characters to be replaced with special characters. I have programmed the extended mode for this.
Feel free to try it out.

3 Likes