Skip to content

Commit 4bbeb4b

Browse files
committed
Added Shell solution for "Transpose File"
1 parent e407010 commit 4bbeb4b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Shell/Transpose File.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
awk '
2+
{
3+
for (i = 1; i <= NF; i++) {
4+
if (FNR == 1) {
5+
t[i] = $i;
6+
} else {
7+
t[i] = t[i] " " $i
8+
}
9+
}
10+
}
11+
END {
12+
for (i = 1; t[i] != ""; i++) {
13+
print t[i]
14+
}
15+
}
16+
' file.txt
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)