Created
July 14, 2016 19:31
-
-
Save alxndrkalinin/402259ddd37864d291875ff96143ef27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { FS=OFS="," } | |
{ | |
for (rowNr=1;rowNr<=NF;rowNr++) { | |
cell[rowNr,NR] = $rowNr | |
} | |
maxRows = (NF > maxRows ? NF : maxRows) | |
maxCols = NR | |
} | |
END { | |
for (rowNr=1;rowNr<=maxRows;rowNr++) { | |
for (colNr=1;colNr<=maxCols;colNr++) { | |
printf "%s%s", cell[rowNr,colNr], (colNr < maxCols ? OFS : ORS) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment