You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
352 B
16 lines
352 B
4 years ago
|
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)
|
||
|
}
|
||
|
}
|
||
|
}
|