Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

write in multiple files python

fn = open("path of input file.txt","r")
fnew = fn.read()
fs = fnew.split('
')
for value in fs:
    f = [open("path of output file to write.txt" %i,'w') for i in range(len(list_of_files))]
    f.write(value)
    f.close()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #multiple #files #python
ADD COMMENT
Topic
Name
3+3 =