BEGIN { print "FILLING LOOKUP TABLE" > "/dev/tty" }

FILENAME == "nodesWithId.csv" {
	map[$2]=$1
	next
}

FNR == 1 {
	print "STARTING MAPPING"  > "/dev/tty"
	print $0
}

FNR > 1 {  print $1 ";" map[$2] ";" map[$3] ";" $4 }

(FNR % 1000) == 0 { printf("%s", ".") >"/dev/tty" }

END {
	print FNR, "records processed" > "/dev/tty"
	print "DONE." > "/dev/tty"
}