I am trying to open a javascript(.js) file and remove all the tabs, new lines and white space from it, this is the code.
f1 = open('file1.js', 'r')
s = f1.read()
s.strip()
s.replace("\t", "")
s.replace(" ", "")
s.replace("\n", "")
f2 = open('file2.js', 'w+')
f2.write("//blobs\n"+s)
f1.close()
f2.close()
I do know that i am reading and writing it correctly because file2.js ends up as file1.js with //blobs as the first line. I have been searching for solutions but they all just point out that you can use strip() and replace()