title: How to loop through all CSV files, open each, and perform some operations on each?
body: <p>I'm trying to loop through all CSV files in a folder, open each, do some find/replace things, then save and close each CSV.  Here is my code, which should be close, I think, but apparently something is off because it's not working.</p>
  
  <pre><code>import glob
  path = "C:\\Users\\ryans\\OneDrive\\Desktop\\downloads\\Products\\*.csv"
  for fname in glob.glob(path):
      print(str(fname))
      with open(str(fname)) as f:
          newText = f.read().replace('|', ',').replace(' ', '')
  
  with open(str(fname), "w") as f:
      f.write(newText)
  </code></pre>
  
  <p>What is wrong here?</p>