def METHOD_NAME(PATH,CONFIG_FILE,NEVENTS,OUTPUTFILE,INDEX):
	config_file=open(CONFIG_FILE,'r')
	config_txt   = config_file.read()               # Read all data
	config_file.close()
	newconfig_path = PATH + "/"+FarmDirectory+"/InputFile/%04i_" % INDEX
        newconfig_path = newconfig_path + Output_RootFile + ".cfg"
	mylogo1 = "#  -----------------------------------------------\n"
	mylogo2 = "# |   cfg modified by the LaunchOnFarm Script     |\n"
	mylogo3 = "# |   Created by Loic Quertenmont                 |\n"
	mylogo4 = "# |   Loic.quertenmont@cern.ch                    |\n"
	mylogo5 = "#  -----------------------------------------------\n\n\n\n"
	config_txt = mylogo1 + mylogo2 + mylogo3 + mylogo4 + mylogo5 + config_txt
	i=0
	while i < len(config_txt) :
		if config_txt[i:i+15]=='XXX_NEVENTS_XXX':
			Skip = INDEX*NEVENTS+Job_SEvents
			MaxEvent = NEVENTS
			print("job #%d" %INDEX + "\t\tNumber of Events fixed to \t\t%d"%MaxEvent)
			newconfig_file=open(newconfig_path,'w')
			newconfig_file.write("%s" % config_txt[0:i])
			newconfig_file.write("%d" % MaxEvent)
			newconfig_file.write("%s" % config_txt[i+15:len(config_txt)])
			newconfig_file.close()
			newconfig_file=open(newconfig_path,'r')
			config_txt   = newconfig_file.read()
			newconfig_file.close()
			i = 0
		if config_txt[i:i+14]=='XXX_OUTPUT_XXX':
			print("job #%d" %INDEX + "\tOutput file fixed to\t\t%s"%OUTPUTFILE)
			newconfig_file=open(newconfig_path,'w')
			newconfig_file.write("%s" % config_txt[0:i])
			newconfig_file.write("%s"% OUTPUTFILE)
			newconfig_file.write("_%04i.root" % INDEX)
			newconfig_file.write("%s" % config_txt[i+14:len(config_txt)])
			newconfig_file.close()
			newconfig_file=open(newconfig_path,'r')
			config_txt   = newconfig_file.read()
			newconfig_file.close()
			i = 0
                if config_txt[i:i+17]=='XXX_SKIPEVENT_XXX':
			Skip = INDEX*NEVENTS+Job_SEvents
                        print("job #%d" %INDEX + "\tNumber of Event to skip is fixed to\t\t%i"%Skip)
                        newconfig_file=open(newconfig_path,'w')
                        newconfig_file.write("%s" % config_txt[0:i])
                        newconfig_file.write("%i"%Skip)
                        newconfig_file.write("%s" % config_txt[i+17:len(config_txt)])
                        newconfig_file.close()
                        newconfig_file=open(newconfig_path,'r')
                        config_txt   = newconfig_file.read()
                        newconfig_file.close()
                        i = 0
                if config_txt[i:i+9]=='XXX_I_XXX':                       
                        newconfig_file=open(newconfig_path,'w')
                        newconfig_file.write("%s" % config_txt[0:i])
                        newconfig_file.write("%04i"%INDEX)
                        newconfig_file.write("%s" % config_txt[i+9:len(config_txt)])
                        newconfig_file.close()
                        newconfig_file=open(newconfig_path,'r')
                        config_txt   = newconfig_file.read()
                        newconfig_file.close()
                        i = 0
		i = i+1