# Specify the file path containing the LDAP search command output ldapsearch_output_file = "ldap_search_output.txt" # Read the LDAP search output from the file with open(ldapsearch_output_file, "r") as file: ldapsearch_output = file.read() # Split the LDAP search output into entries entries = ldapsearch_output.strip().split("\n\n") # Create an HTML string to store the HTML content html_content = "\n
\n" # Iterate through each LDAP entry and convert it to HTML for entry in entries: lines = entry.split("\n") html_content += "{key} | {value} |