def main(argv = None):
    
    if argv == None:
        argv = sys.argv
        
    inFeatureClassPath = arcpy.GetParameterAsText(0).strip('"')
    outFeatureClassPath = arcpy.GetParameterAsText(1).strip('"')
    putTheseFirst = arcpy.GetParameterAsText(2).lower().split(";")
    
    outWorkspace = os.path.dirname(outFeatureClassPath)
    outName = os.path.basename(outFeatureClassPath)
    
    fieldMappings = arcpyh.getSortedFieldMappings(arcpy, inFeatureClassPath, putTheseFirst)

    arcpy.FeatureClassToFeatureClass_conversion(inFeatureClassPath, outWorkspace, outName, None, fieldMappings)
def main(argv = None):
    
    if argv == None:
        argv = sys.argv
    
    #Input Arguments
    inTablePath = arcpy.GetParameterAsText(0).strip('"')
    outTablePath = arcpy.GetParameterAsText(1).strip('"')
    putTheseFirst = arcpy.GetParameterAsText(2).lower().split(";")
    
    outWorkspace = os.path.dirname(outTablePath)
    outName = os.path.basename(outTablePath)
    
    fieldMappings = arcpyh.getSortedFieldMappings(arcpy, inTablePath, putTheseFirst)
    
    arcpy.TableToTable_conversion(inTablePath, outWorkspace, outName, None, fieldMappings)