This script should do it, under a few assumptions anyway. For example, it will break if attributes in the div tag contain a closing angle bracket (>), if the order of the title and creator attributes changes, or if the div tag spans multiple lines.
#!/usr/bin/awk -f
# treat the opening tag line here
/<div title=".*" creator=".*"/ {
indiv = 1 # inside div from here on
name = gensub(/.* title="([^"]+)".*/, "\\1", "") # extract name
tagsattr = gensub(/.* tags="([^"]+)".*/, "\\1", "") # extract tags string
split(tagsattr, tags, /, /) # split tags into array
print(name) > name # print name into file "name"
for(tag in tags) printf("@%s ", tags[tag]) >> name # print tags with "@" prefix
printf("\n\n") >> name # two newlines
sub(/.*<div [^>]+>/, "") # remove the tag so the rest
# of the line can be printed
}
# treat closing line
indiv == 1 && /<\/div>/ {
sub(/<\/div>.*/, "") # remove tag so the rest
print >> name # can be printed
indiv = 0 # outside div from here on
}
# print all other lines inside of div
indiv == 1 {
print >> name
}
chmod +x it and call with input file name as argument. As it is, it will create its output file in the current directory, so be careful.
If your input files are structured in a directory tree, you may have to find the right command line with shell wildcards, loops, or the find utility.