def save_rdb(dic, keys, file):
    """
    From a disctionary 'dic' saves the columns related to the specified 'keys' into an .rdb file named 'file'.
    """
    out = open(file, 'w')
    n_keys = len(keys)
    for k in range(n_keys):
        if k != n_keys - 1:
            out.write('{}\t'.format(keys[k]))
        else:
            out.write('{}'.format(keys[k]))
    out.write('\n')
    for k in range(n_keys):
        if k != n_keys - 1:
            out.write('{}\t'.format('-' * len(keys[k])))
        else:
            out.write('{}'.format('-' * len(keys[k])))
    out.write('\n')
    for i in range(len(dic[keys[0]])):
        for k in range(n_keys):
            if k != n_keys - 1:
                out.write('{}\t'.format(dic[keys[k]][i]))
            else:
                out.write('{}'.format(dic[keys[k]][i]))
        out.write('\n')
    out.close()
