Typo gefixt

This commit is contained in:
2025-06-14 09:23:25 +02:00
parent 02509c5615
commit a71807d3b6
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Eingabedatei
INPUT_FILE="Homelab.mxtsessions"
# Ausgabedatei
OUTPUT_FILE="serverliste.csv"
# Kopfzeile der CSV schreiben
echo "Name,Adresse / Host" > "$OUTPUT_FILE"
# Daten extrahieren und formatieren
grep -oP '^[^=]+=#109#0%[^%]+' "$INPUT_FILE" | while IFS= read -r line; do
name=$(echo "$line" | cut -d'=' -f1 | sed 's/.*\\n//')
host=$(echo "$line" | cut -d'%' -f2)
echo "$name,$host" >> "$OUTPUT_FILE"
done
echo "Export abgeschlossen: $OUTPUT_FILE"