title: how to get the directory names for every file?
body: <pre><code>root
  --- audi    (dirs)
             ---11 01012020.csv  (files)
             ---01 102020.csv
  --- bmw
              ---66  10052020.csv
              ---43  11112020.csv
  --- mercedes
               ---34  21062020.csv
               ---23  30112020.csv
  </code></pre>
  <p>Above is the structure of my root, dirs and paths. Im trying to get 3 things. <code>car</code>, <code>file_id</code> and <code>date</code>.</p>
  <ol>
  <li><code>Car</code> is the name of the directory</li>
  <li><code>file_id</code> is the first split( aka
  everything before the 1st whitespace in the filename)</li>
  <li><code>date</code> is everything after the
  first whitespace in the filename..</li>
  </ol>
  <p>This is my code:</p>
  <pre><code>for root, dirs, files in os.walk(path_root):
      for file in files:
          if file.endswith('.csv'):
              file_id = file.split()[0]
              date = re.search(' (\d+).', file).group(1)
              car = ? idk how to get this one.
  </code></pre>
  <p>As you can see I managed to get <code>file_id</code> and <code>date</code>. Now I want to get the car name (name of directroy) for every file... what is the easietst way to achieve that?</p>