namens check

This commit is contained in:
Alexander Bachinger
2025-05-27 10:45:26 +02:00
parent a43cebc636
commit 96ee2f97ef
4 changed files with 28 additions and 1 deletions

View File

View File

View File

@@ -0,0 +1,28 @@
package UE00_Other.namen_check;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class namen_check {
public static void main(String[] args) throws IOException {
List<String> kontakte = new ArrayList<>();
List<String> namen = new ArrayList<>();
for (String line : Files.readAllLines(Path.of("src/UE00_Other/namen_check/kontakte.vcf"))) {
Matcher matcher = Pattern.compile("N:(.*;.*);.*;.*;").matcher(line);
while (matcher.find()) kontakte.add(matcher.group(1));
}
for (String line : Files.readAllLines(Path.of("src/UE00_Other/namen_check/namen.csv"))) {
Matcher matcher = Pattern.compile("\"([^\"]+)\"\\s+<[^>]+>").matcher(line);
while (matcher.find()) namen.add(matcher.group(1));
}
for (String kontakt : kontakte)
for (String name : namen)
if (kontakt.split(";")[0].equalsIgnoreCase(name.split(" ")[0]))
System.out.println(name + " - " + kontakt.replaceAll(",", " "));
}
}

View File

@@ -131,6 +131,5 @@ public class MatheClient extends Thread {
} }
} catch (Exception _) { } catch (Exception _) {
} }
} }
} }