| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| BEGIN {FS=":"} |
| |
| { |
| if ($1 == 0 && $2 == $3) { |
| opentags = "<ul><li>" |
| closetags = "" |
| } |
| |
| if ($1 > 0 && $2 > $3) { |
| opentags = "<ul><li>" |
| closetags = "" |
| } |
| |
| if ($1 > 0 && $2 == $3) { |
| opentags = "</li><li>" |
| closetags = "" |
| } |
| |
| if ($1 > 0 && $2 < $3) { |
| opentags = "" |
| for (i = 1; i <= ($3 - $2); i++) { |
| opentags = opentags "</li></ul>" |
| closetags = "" |
| } |
| opentags = opentags "</li><li>" |
| } |
| |
| printf "%s%s%s\n",opentags,$4,closetags |
| |
| } |
| |
| END { |
| |
| if ($1 > 0 && $2 >= $3 && $3 > 1) { |
| for (i = 1; i <= $3; i++) { |
| print "</li></ul>" |
| } |
| } |
| |
| if ($1 > 0 && $2 >= $3 && $3 == 1) { |
| print "</li></ul>" |
| print "</li></ul>" |
| } |
| |
| if ($1 > 0 && $2 < $3) { |
| for (i = 1; i <= $2; i++) { |
| print "</li></ul>" |
| } |
| } |
| |
| print "</div>" |
| } |