Linux-shell怎样把行转为列

如题所述

awk '{ for(i=1;i<=length($0);i++)
        col[i]=col[i] substr($0,i,1)
    }
    END { i=1
        while (i in col)
        {
            print col[i]
            i++
        }
    }' filename

温馨提示:内容为网友见解,仅供参考
第1个回答  2015-09-06
cat filename.txt | sed 's/\( \)\+/\n/g'
相似回答