title: How to get a 'clean' list of excel worksheet tab names in R with RODBC?
body: <p>I'm new to R and even newer to using it with Excel. I want to get a list of all the worksheet names (Notes,Weights,Lengths) in an .xls file. You can see what I'm trying below - the problem is that the output has a $ dollar sign at the end for some reason and is sometimes also surrounded with single quotes. </p>
  
  <pre><code>FileToImport &lt;- "C:\\folder\\filetoimport.xls"
  
  z &lt;- odbcConnectExcel(FileToImport, readOnly = TRUE)
  
  sqlTables(z)
  TABLE_CAT TABLE_SCHEM         TABLE_NAME   TABLE_TYPE REMARKS
  1 C:\\folder\\filetoimport.xls &lt;NA&gt;     Notes$ SYSTEM TABLE    &lt;NA&gt;
  2 C:\\folder\\filetoimport.xls &lt;NA&gt; 'Weights$'        TABLE    &lt;NA&gt;
  3 C:\\folder\\filetoimport.xls &lt;NA&gt; 'Lengths$'        TABLE    &lt;NA&gt;
  </code></pre>
  
  <p>sqlTables(z)[,"TABLE_NAME"]</p>
  
  <pre><code>[1] "Notes$"             "'Weights$'" "'Lengths$'"
  </code></pre>
  
  <p>I could try to clean these characters up but I don't really know how to go about this since the quotes format is inconsistent - some of the workbooks are "SYSTEM TABLEs" and some are just "TABLEs". Could someone explain what the difference between these worksheets is and give me an idea of how to recreate just the 'clean' tabnames? </p>