title: Using a field in one file to populate a field in another
body: <p>Any ideas on how to approach this would be awesome.</p>
  <p>I've tried using a nested for loop but have no luck, when trying to get the matching streets/lines of data. with the first loop not iterating correctly in the second.</p>
  <p>So I have two files. I need to populate <code>file1</code> with the correct, respective <code>parcelid</code> from <code>file2</code>.</p>
  <p>My idea is to iterate through both files.</p>
  <ul>
  <li><code>file1</code> is a set of dirty, random, user input addresses within a county</li>
  <li><code>file2</code> is clean parcel data from the county</li>
  <li><code>file1</code> contains <code>address</code></li>
  <li><code>file2</code> contains <code>address</code>,<code>parcelid</code></li>
  </ul>
  <p>Using <code>usaddress</code>, I want to parse the address and use the street number only for each file. Then, for each line in <code>file1</code>, I want to find every line in <code>file2</code> with a matching number giving a list of every street name in the county with that number. Then, using the street name and <code>fuzzywuzzy</code>, I will find the closest matched address. Then, with that selected, I want to take that <code>parcelid</code> from <code>file2</code> and assign it to that line in <code>file1</code>.</p>
  <p>This is how far I've gotten:</p>
  <pre class="lang-py prettyprint-override"><code>import os.path
  import csv
  import usaddress
  
  CWD = str(os.getcwd()) #To call files easier
  
  with open(CWD + &quot;\\Temp_Data\\Wells.csv&quot;) as f, open(CWD + &quot;\\Temp_Data\\Parcels.csv&quot;) as g:
      wells = csv.reader(f, delimiter=',')
      next(wells)
      parcels = csv.reader(g, delimiter=',')
      next(parcels)
      for lines2 in parcels:
          address2= lines2[9]
          parcel_id2 = lines2[1]
          if address2 == '' or address2 == ' ':
              address2 = ''
          else:
              try:
                  addressbrk2 = usaddress.tag(address2)
              except usaddress.RepeatedLabelError:
                  addressbrk2 = address2
          address2 = addressbrk2
          if address2 == '' or isinstance(address2, str):
              roadnum2 = ''
          else:
              roadnum2 = address2[0].get('AddressNumber', '')
          if address2 == '':
              roadname2 = ''
          else:
              roadname2 = address2[0].get('StreetName', '')
  
          for lines1 in wells:
              parcel_id1 = lines1[82]
              address1 = lines1[10]
              address1 = address1.strip()
              if address1 == '' or address1 == ' ':
                  address1 = ''
              else:
                  try:
                      addressbrk1 = usaddress.tag(address1)
                  except usaddress.RepeatedLabelError:
                      addressbrk1 = address1
              parcel_id1 = lines1[82]
              address1 = addressbrk1
              if address1 == '' or isinstance(address1, str):
                  roadnum1 = ''
              else:
                  roadnum1 = address1[0].get('AddressNumber', '')
              if address1 == '':
                  roadname1 = ''
              else:
                  roadname1 = address1[0].get('StreetName', '')
              if roadnum1 == roadnum2:
                  print(roadname2)
  </code></pre>