Last active
June 16, 2017 21:03
-
-
Save JonRoosevelt/463b2854eab765531f2cf1be0edd5c5a to your computer and use it in GitHub Desktop.
Pequeno programa para remover quebras de linha de arquivos txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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