#!/bin/bash

fig_file=$1

(grep '^[1235]\b' $fig_file | while read obj_code sub_type line_style thickness pen_color fill_color depth remaining ; do
    echo "${depth}"
done

grep '^4\b' $fig_file | while read obj_code sub_type color depth remaining ; do
    echo "${depth}"
done) | sort -u | sed "s/.*/${fig_file}\t&/"
