My method for this was to use the Field Mappings and Table to Table conversion functions. Using field mappings you can set new fields based on the names of fields in your input table.
The following link has examples for feature classes: http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000007p000000
My code below will change all fields in an input table that start with "All_txt_" to a new name. For example "All_txt_SomeName" to "SomeName".
import os
import arcpy
table = r"PATH TO INPUT TABLE"
new_tb = r"PATH TO OUTPUT TABLE"
field_mappings = arcpy.FieldMappings() # Create new field mapping object
#Loop through fields. For each field, create a corresponding FieldMap object.
#If the name begins with "ALL_txt_", create a new name.
#Note: "FID and "Shape" are skipped
for field in arcpy.ListFields(table):
if not field.name == "FID" and not field.name == "Shape":
old_name = field.name
#Rename if necessary
if old_name.startswith("All_txt_"):
new_name = old_name.strip("All_txt_")
else:
new_name = old_name
#Create new FieldMap object
new_f = arcpy.FieldMap()
new_f.addInputField(table,old_name) # Specify the input field to use
#Rename output field
new_f_name = new_f.outputField
new_f_name.name = new_name
new_f_name.aliasName = new_name
new_f.outputField = new_f_name
#Add field to FieldMappings object
field_mappings.addFieldMap(new_f)
#Convert table using your created Field Mappings object
arcpy.TableToTable_conversion(table, os.path.dirname(new_tb), os.path.basename(new_tb), field_mapping=field_mappings)
Hope this solves your problem!
(If you wish to carry out this process on a feature class, just specify the input/output as valid feature class paths and use FeatureClassToFeatureClass_conversion.)