The awk code loops over each input line. Outside a { } you can use a selector that works like an if condition for the following { code block }
If you are more familiar with shell code - the following shell code is quite similar
while IFS= read line
do
case $line in
("#"*)
# chop the leading character then a space
line=${line#?}
line=${line#" "}
echo "<h1>$line</h1>"
;;
("-"*)
line=${line#?}
line=${line#" "}
echo "<ul>$line</ul>"
;;
(*) # The * matches everything so this is like an "else"
echo "<p>$line</p>"
;;
esac
done < Input_file
Explanation: there are 3 conditions I am checking here. 1st if a line starts from # then substitute one or more occurrences of it with null and print h1 tag before and after the line. In 2nd condition checking if a line starts from - then substitute one or more occurrences of it, then printing ul tag before and after current line.
Finally checking 3rd condition if line is NOT starting from # and - then add
Hello JameEnder, l have done this kind of edit before, I always make a copy of the file to work on, then after my script works I make one more copy of the file (file.orig) then copy the good working file to where it needs to be located. This procedure has save me more than one time. From your question it sounded like you might be new to sed and awk.