DEV Community

Query Filter
Query Filter

Posted on

flip

flip_cols() {
  local col1="$1"
  local col2="$2"

  awk -F'~' -v OFS='~' -v c1="$col1" -v c2="$col2" '
  {
    tmp = $c1
    $c1 = $c2
    $c2 = tmp
    print
  }'
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)