BEGIN { IgnoreFlag = "Y" DescName = " " ComplexFlag = "N" PullNameFlag = "N" PullValueFlag = "N" } { if ( PullNameFlag == "Y" ) { DescName = PullName() next } if ( PullValueFlag == "Y" ) { DescName = PullValue() next } if ( ( $1 == "" ) { print DescName IgnoreFlag = "N" } if ( IgnoreFlag == "Y" ) { next } if ( $0 ~ "" ) { ComplexFlag = "N" IgnoreFlag = "Y" } print } function PullName() { PullNameFlag = "N" #print NF for ( i = 1 ; i <= NF ; i++ ) { #print $i if ( substr($i,1,5) == "name=" ) { #print $i return $i } } if ( substr($NF,length($NF)) != ">" ) { #print "Split line" PullNameFlag = "Y" } } function PullValue() { PullValueFlag = "N" #print NF for ( i = 1 ; i <= NF ; i++ ) { #print $i if ( substr($i,1,6) == "value=" ) { #print $i return $i } } if ( substr($NF,length($NF)) != ">" ) { #print "Split line" PullValueFlag = "Y" } }