summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wührer <def@gmx.at>2023-07-03 15:48:48 +0200
committerDavid Wührer <def@gmx.at>2023-07-03 15:48:48 +0200
commit4e0ac4acb97308b782c39d1137f03a56f635c88f (patch)
tree3bbb7f7709f4933529d52a01989891d153517da4
parent044b08d127cef08545f831a0c4960d450680679b (diff)
pivot, strjoin
-rwxr-xr-xpivot11
-rwxr-xr-xstrjoin6
2 files changed, 17 insertions, 0 deletions
diff --git a/pivot b/pivot
new file mode 100755
index 0000000..3c750f2
--- /dev/null
+++ b/pivot
@@ -0,0 +1,11 @@
+#!/usr/bin/awk -f
+
+{
+ split ($0, _columns, "\t")
+ for (i=0;i<length(_columns);++i) {
+ columns[i] = columns[i] "\t" _columns[i]
+} }
+END {
+ for (i=0;i<length(columns);++i) {
+ print substr(columns[i],2)
+} }
diff --git a/strjoin b/strjoin
new file mode 100755
index 0000000..83b2a9c
--- /dev/null
+++ b/strjoin
@@ -0,0 +1,6 @@
+#!/bin/sh
+sep=$1
+shift
+printf '%s' "$1"
+shift
+printf "$sep"'%s' "$@"