leetcode 194. Transpose File 发表于 2018-09-25 | 分类于 leetcode 题目链接:leetcode 1234567891011121314151617# Read from the file file.txt and print its transposed content to stdout.awk '{ for (i = 1; i <= NF; i++) { if (FNR == 1) { t[i] = $i; } else { t[i] = t[i] " " $i } }}END { for (i = 1; t[i] != ""; i++) { print t[i] }}' file.txt