Created
December 20, 2016 13:23
-
-
Save packmad/8cdc924b191d6ccc6befafccb025505a to your computer and use it in GitHub Desktop.
Read a file and filter its content into another file
This file contains 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("/tmp/output.txt", "w") as output_file: | |
with open("/tmp/input.txt", "r") as input_file: | |
for line in input_file: | |
# process line | |
print(line, file=output_file, end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment