Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. awk '
  2. # translate.awk
  3.  
  4. NR==1 {
  5.    split($0,hosts)
  6. }
  7. NR==2 {
  8.    split($0,ids)
  9. }
  10. NR==3{
  11.    split($0,ips)
  12. }
  13. NR==4{
  14.    split($0,names)
  15. }
  16. NR==5{
  17.    split($0,roles)
  18. }
  19. NR==6{
  20.    region=$1
  21. }
  22.  
  23. END{
  24.    OFS="\t"
  25.    for(i in hosts) {
  26.        print hosts[i], ids[i], ips[i], names[i], roles[i], region
  27.    }
  28. }
  29. ' input.file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement