dnsmanager/bin/migration-final.awk

32 lines
437 B
Awk
Raw Normal View History

#!/usr/bin/gawk -f
BEGIN {
OFS = "\t"
}
/^\[/ || /^\]/ {
next
}
{
domain = $0
login = $0
gsub("^.+domain\": \"", "", domain)
gsub("\",\"login\": .+", "", domain)
gsub(".+\",\"login\": \"", "", login)
gsub("\" }.?$", "", login)
data[login][domain] = 1
}
END {
for ( login in data ) {
domains = ""
nb = 0
for ( domain in data[login] ) {
nb += 1
domains = (domains "\t" domain)
}
print nb, login, domains
}
}