out_fname_str.replace(0, 6,"output_"); is faster and is sutable for this task cause input file name doesn't change