title: How to save tokenization result for each file in a new separate text file?
body: <p>I have 349 text file. I use the following code to read and tokenize all of them. </p>
  
  <pre><code>import glob
  path = "C:\\texts\\*.txt"
  for file in files:
     with open (file) as in_file, open ("C:\\texts\\file_tokens.txt", 'w') as out_file:
         for line in in_file:
             words = line.split()
             for word in words:
                 out_file.write(word)
                 out_file.write("\n")
  </code></pre>
  
  <p>This code save the result (all tokens) in one file (file_tokens.txt). How can I save the tokens of each file in a new .txt file? I mean I want 349 files in output as each contains the tokens of each file.</p>