Hi,
I have a Feature Class to Feature Class script that is supposed to take a Feature Class (FC) of locations and create a separate FC for each location. However, it keeps giving me the following two errors.
ERROR <SPAN class="number token">000210</SPAN><SPAN class="punctuation token">:</SPAN> Cannot create output E<SPAN class="punctuation token">:</SPAN>\arcGIS_Shared\Business Analyst\PotentialCitePackages<SPAN class="punctuation token">.</SPAN>gdb\NorthEdmond
ERROR <SPAN class="number token">000354</SPAN><SPAN class="punctuation token">:</SPAN> The name contains invalid characters
Failed to execute <SPAN class="punctuation token">(</SPAN>FeatureClassToFeatureClass<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Here is the FC to FC script:
inFeatures <SPAN class="operator token">=</SPAN> <SPAN class="string token">"PythonTest_Geocoded"</SPAN>
fields <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'ObjectID'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'Shape'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'USER_Center'</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>SearchCursor<SPAN class="punctuation token">(</SPAN>inFeatures<SPAN class="punctuation token">,</SPAN> fields<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
outLocation <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"E:\arcGIS_Shared\Business Analyst\PotentialCitePackages.gdb"</SPAN>
outFeatureClass <SPAN class="operator token">=</SPAN> <SPAN class="string token">"{0}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
delimitedField <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>AddFieldDelimiters<SPAN class="punctuation token">(</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"USER_Center"</SPAN><SPAN class="punctuation token">)</SPAN>
expression <SPAN class="operator token">=</SPAN> delimitedField <SPAN class="operator token">+</SPAN> <SPAN class="string token">" = '{0}'"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>expression<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">## Execute FeatureClassToFeatureClass</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>FeatureClassToFeatureClass_conversion<SPAN class="punctuation token">(</SPAN>inFeatures<SPAN class="punctuation token">,</SPAN> outLocation<SPAN class="punctuation token">,</SPAN> outFeatureClass<SPAN class="punctuation token">,</SPAN> expression<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The output FCs are supposed to be named after their corresponding locations ('USER_Center"). This field contains no invalid characters, as you can see below (I was testing this code on a table with only 3 rows).

Could someone help me figure out what I'm doing wrong/missing?
Thanks.