final.awk 410 B

12345678910111213141516171819202122232425
  1. /aledger error/ {
  2. print $0
  3. exit 1
  4. }
  5. {
  6. before = ""
  7. seen = FALSE
  8. spaces = ""
  9. split($1, sep, ":")
  10. for(i = 1; i < length(sep); i++) {
  11. if(before == "") {
  12. before = sep[i]
  13. spaces = spaces " "
  14. } else {
  15. before = before ":" sep[i]
  16. spaces = spaces " "
  17. }
  18. if(seet[before]) {
  19. seen = TRUE
  20. }
  21. }
  22. print spaces sep[length(sep)] " " $2
  23. seet[before] = TRUE
  24. }