s/comment --- transform a list of nodenames followed by a ---/&/ s/comment --- chapter or a section name, into a Sed script ---/&/ s/comment --- which adds chapter, section numbers to indices. ---/&/ /^@node[ ]/ { N s/\n/!!=!!/ /^@node *Top[^a-z]/d s/^@node *\([^,][^,]*\),.*!!=!!@\([a-z][a-z]*\)[ ][ ]*\([0-9]\(\.*[0-9]\)*\).*/s|\\(@w{\1}.*<\/A>\\)@\\*|\\1 [\2 \3]@*|/ }