Fixed Width Formatter always adds one blank line

I’m using the Fixed Width Formatter snap to create a .txt file with one line in it, but it always writes the file with one extra blank line at the end.
I tried adding the Head snap using 0 offset, 1 number of documents and tried 1 offset, 1 number of documents. Still didn’t work. Does anyone know how to prevent the one extra blank line?

That’s just the way the Preview works. If you write the output to a file and download it, you’ll find it really only has one line.

The file has 2 lines.

test_header.txt (351 Bytes)

Again, that’s just the way a text editor shows a file with one line that ends with a newline. It’s allowing you to enter more text for line 2.

The unix wc utility agrees that your file is one line:

$ wc -l test_header.txt 
       1 test_header.txt

If you do a hexdump of your file, you’ll see only one newline character (0a), at the very end:

Got it. Thanks for your help here, really appreciate it. Love this community :+1:

1 Like