Last active
September 13, 2016 12:28
-
-
Save adtraub/e714e8ad94d0a08aca3d to your computer and use it in GitHub Desktop.
Simple Python Script to remove new lines from a file and save the output to a new file - not meant to be particularly robust
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
def removeNewLines(inputFileName, outputFileName): | |
with open(outputFileName, 'w') as outFile: | |
with open(inputFileName, 'r') as inFile: | |
outFile.write(inFile.read().replace('\n', '')) | |
if __name__ == "__main__": | |
inputFileName = input("input file name: ") | |
outputFileName = input("output file name: ") | |
removeNewLines(inputFileName, outputFileName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment