transpose()
{
awk '
BEGIN {
FS = ",";
OFS = ",";
}

{
if (max_nf<NF)
max_nf=NF
max_nr=NR
for (x=1; x<=NF; ++x)
vector[x, NR]=$x
}

END {
for (x=1; x<=max_nf; ++x) {
for (y=1; y<=max_nr; ++y)
printf("%s,", vector[x, y])
printf("\n")
}
}' ${1}
}

transpose ${1}

https://stackanswers.net/questions/how-to-do-a-transpose-in-bash-awk-other-duplicate

相关文章:

  • 2021-11-17
  • 2021-11-30
  • 2021-12-28
  • 2021-09-15
  • 2021-08-19
  • 2021-09-10
  • 2023-02-16
猜你喜欢
  • 2022-12-23
  • 2021-09-19
  • 2021-06-29
  • 2022-12-23
  • 2021-11-12
  • 2021-10-22
  • 2022-02-08
相关资源
相似解决方案