cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed Width Formatter always adds one blank line

gg433
New Contributor III

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?

extra_line

4 REPLIES 4

ptaylor
Employee
Employee

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.

gg433
New Contributor III

The file has 2 lines.

test_header.txt (351 Bytes)

extra_line2

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:

image

gg433
New Contributor III

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