#!/bin/sh # Invoke this script with the name of the file containing the tablespace info awk ' $1 == "TABLE:" { n = substr($3, 1, length($3) -1); } $1 == "INDEX:" && $3 ~ /PRIMARY|GEN_CLUST_INDEX/ { i = substr($3, 1, length($3) -1); printf "%-30s %-15s %d %d\n", n, i, $5, substr($6, 1, length($6) - 1); }' "$@"