title: Python search corresponding data in multiple excel and paste to a new excel worksheet
body: <p>i have some excel files in a folder, there's already a worksheet call "service" in each file</p>
  
  <pre><code>Notes_111.xlsx
  Notes_222.xlsx
  Notes_888.xlsx
  </code></pre>
  
  <p><strong>Workflow</strong> : I want to open each .xlsx file, for example, Notes_111.xlsx, then add a new worksheet, name as "code_city", then based on file's name <strong>111</strong>, extract only the <strong>code = 111</strong> data from the master dataframe and paste to the new worksheet. then save.</p>
  
  <p>Sample master dataframe in another excel file</p>
  
  <pre><code>    code           city
  0    111            NY
  1    111            CA
  2    222            NJ
  3    888            WE
  4    888            TL
  </code></pre>
  
  <p>i don't know how to write a logic within a loop to search corresponding data</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import glob
  from openpyxl import load_workbook
  
  for f in glob.glob(path + "Notes_*.xlsx"):
     wb = load_workbook(f)
     ws = wb.create_sheet('code_city')
     ws['A1'] = 'how to search corresponding data and paste here???'
     wb.save(f)
  </code></pre>
  
  <p>please help.</p>