def mergeParameters(filenames, save_to='_namd.prm', ff='charmm', reverse=False, fill_with_zeros=False):
    '''A unitility tool to merge multiple CHARMM parameter files: a latter files override the previous one'''

    from os      import path
    from time    import asctime, localtime, time
    from ...io   import files, format
    from ...data import forcefield

    from sys import stdout

    ffObj = forcefield.getFFObj(ff)

    dict_data = {}

    strbuff = ''

    # single file
    if type(filenames) is str:
        file_path = ffObj.getFullPath(filenames)
        files.prm.parse(file_path, receiver=dict_data, override_existing=(not reverse))
        strbuff += '! ' + file_path + '\n'
    # assuming iterables such as list or tuple
    else:
        # latter overriding former
        if not reverse:
            format.printwrap('NB: in function mergeParameters() data of latter files will override former ones',
                             indent='', initial_indent=' ', subsequent_indent='     ')
        # former overriding latter
        else:
            format.printwrap('NB: in function mergeParameters() data of former files will override latter ones',
                             indent='', initial_indent=' ', subsequent_indent='     ')

        for fname in filenames:
            file_path = ffObj.getFullPath(fname)
            files.prm.parse(file_path, receiver=dict_data, override_existing=(not reverse))
            strbuff += '! ' + file_path + '\n'

    with open(save_to, 'w') as fp:
        fp.write('! CHARMM parameters file generated by ChemShell from\n')
        fp.write(strbuff)
        fp.write(f'! {asctime(localtime(time()))}')

    files.prm.write(save_to, dict_data, append=True, fill_with_zeros=fill_with_zeros)


