def format_file(source, target, **kwargs):
    """Format Input File."""
    with open(target, 'w') as target_file:
        with open(source, 'r') as source_file:
            for line in source_file:
                try:
                    target_file.write(line.format(**kwargs))
                except KeyError:
                    target_file.write(line)
