How do I stop FileZilla from changing formatting of my .txt file

0

I have recently started using AWS EC2 and I've been experimenting with it. I've been using FileZilla for SFTP. I used the following python code to create a file so that I can transfer the file to my local computer.

import numpy as np
alp = range(1,5000)
file = 'aws_text_numbers.txt'
with open(file,'a+') as f:
    for i in alp:
        f.write(str(i)+'\n')

Expected output: Text file with 1 to 4999 printed line by line.

When I run this script locally, it gives me the expected output.

When I read the file in the ec2 instance, I get the expected output.

Problem: When I transfer the .txt file from the ec2 instance onto my local machine, I get a text file where 1 to 4999 are printed with no spaces and random line breaks.

I have already tried changing my default FTP file type to binary but the problem still persists.

Rohit Suresh

Posted 2019-07-19T21:53:51.043

Reputation: 1

2Random line breaks from non-random would indicate corruption. Is it perhaps no line breaks with line wrapping? If so it sounds more like a difference in EOL character interpretation. – Ross – 2019-07-19T22:48:47.770

No answers