title: Multiple download - CSV file
body: <p>I have a script, below, that can download files from a particular row from <strong>1 only CSV file</strong>. I have no problem with it, it works well and all files are downloaded into my 'Python Project' folder, root.</p>
  <p>But I would like to add functions here, First, download not only 1 but multiple (20 or more) CSV files then I don't have to change the name manually here - <em>open('<strong>name1</strong>.csv')</em> everytime my script has done the job. Second request, downloads need to be placed in a folder with the same name of the csv file that downloads come from. Hopefully I'm clear enough :)</p>
  <p>Then I could have:</p>
  <ul>
  <li>name1.csv -&gt; name1 folder -&gt;  download from name1 csv</li>
  <li>name2.csv -&gt; name2 folder -&gt;  download from name2 csv</li>
  <li>name3.csv -&gt; name3 folder -&gt;  download from name3 csv</li>
  <li>...</li>
  </ul>
  <p>Any help or suggestions will be more than appreciate :) Many thanks!</p>
  <pre><code>from collections import Counter
  import urllib.request
  import csv
  import os
  
  with open('name1.csv') as csvfile:  #need to add multiple .csv files here.
      reader = csv.DictReader(csvfile)
      title_counts = Counter()
      
      for row in reader:
          name, ext = os.path.splitext(row['link'])
          title = row['title']
          title_counts[title] += 1
          title_filename = f&quot;{title}_{title_counts[title]}{ext}&quot;.replace('/', '-') #need to create a folder for each CSV file with the download inside.
          urllib.request.urlretrieve(row['link'], title_filename)
  </code></pre>