def parse_hostname_from_filename(file):
    """Parses hostname from filename"""

    # strip path
    hostname = file.split("/")[-1].split("\\")[-1]
    
    # strip extensions
    hostname = hostname.split(".")[0]

    return hostname