Reading File - Odd character return output?

Hi,

Pic below hopefully helps.

When I read a simple text file it reads each line but appears to add a character return for all expect the last line(which has no return). This causes issues processing the output in next steps as the value isn`t as expected. For example:

"XXXXXXXXXX"

is actually

"XXXXXXXXXX
"

Text file created in notepad++ on windows 11.

I`ve noticed that when I select text in notepad++ it highlights a space at the end of each line except the last. Pic:
node red issue pic2

Maybe encoding of file? Tried utf-8 but not luck.

Any ideas?

Thank you

Humm I couldn't replicate this using notepad as the source, regardless of encoding?

In notepad++ if you select view then show symbol then show all it might give you a clue.

Alternatively there is a handy node to remove white space and many other options.

1 Like

As you're on Windows, I'm guessing you're going with the standard Notepad++ & Windows setting: NewLine there is CR LF (2 characters,\r\n) - as stated in the footer line of NP++:

image

The FileIn-Node splits the incoming stream yet Linux/Unix-like @ \n:

What you see could be the leftover \r portion of the Windows-like NewLine sequence.

Possible solution: Change the format of the file created by NP++ to UNIX (LF) ... by e.g. right-clicking on the field in the footer & appropriate selection ... or propose a PR to extend the capabilities of the FileIn-Node, allowing to select the LineSplit character sequence.

1 Like

@smcgann99 Did the trick - Thank you

@ralphwetzel - Thank you

1 Like

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