Return to Snippet

Revision: 25069
at March 18, 2010 22:32 by evertwh


Initial Code
#!/usr/bin/awk

NR == 1 {
  for ( i = 1 ; i <= NF ; i++ ){
    line[i] = $i;
  }
  
  next;
}

{
  for ( i = 1 ; i <= NF ; i++ ){
    line[i] = line[i] OFS $i;
  }
}

END {
  for ( i = 1 ; i <= length(line) ; i++){
    print line [i]
  }
}

Initial URL

                                

Initial Description

                                

Initial Title
transpose rows and columns with awk

Initial Tags
Bash

Initial Language
Awk