Skip to content

Instantly share code, notes, and snippets.

@JonRoosevelt
Last active June 16, 2017 21:03
Show Gist options
  • Select an option

  • Save JonRoosevelt/463b2854eab765531f2cf1be0edd5c5a to your computer and use it in GitHub Desktop.

Select an option

Save JonRoosevelt/463b2854eab765531f2cf1be0edd5c5a to your computer and use it in GitHub Desktop.
Pequeno programa para remover quebras de linha de arquivos txt
with open('entrada.txt') as texto, open('saida.txt', 'w') as saida: # Crie um arquivo chamado 'entrada.txt' e cole o texto dentro. Não é necessário criar 'saida.txt' o programa já irá criá-lo automaticamente.
for linha in texto.readlines():
linha = linha.replace('\n', '')
saida.write(linha)
texto.close()
saida.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment