title: How to extract data from a filename in python? - convert file name to string?
body: <p>I am trying to extract the meta data for some experiments I'm helping conduct at school. We are naming our data files something like this:</p>
  <p>name_date_sample_environment_run#.csv</p>
  <p>What I need to do is write a function that separates each piece to a list that'll be output like this:</p>
  <p>['name', 'date', 'sample', 'environment', 'run#']</p>
  <p>Though I haven't quite figured it out. I think I need to figure out how to load the file, convert the name to a string, then use a delimiter for each underscore to separate each into the given list. I don't know how to load the file so that I can convert it to a string. Any help will be appreciated!</p>
  <p>P.S - I will eventually need to figure out a way to save this data into a spreadsheet so we can see how many experiments we do with certain conditions, who performed them, etc. but I can figure that out later. Thanks!</p>