awk 命令在创建 HTML 时出现语法错误

Awk command gets a syntax error when creating an HTML

尝试创建一个从 TXT(从逗号分隔的 CSV 转换而来)创建 HTML 的脚本,但我在第一次打印时收到语法错误“\ the mark shows”,但我找不到为什么有线索?

awk 'BEGIN {
 FS=","
 print "<style>\
    .my_table {font-size:8.0pt; font-family:\"Verdana\",\"sans-serif\"; border-bottom:3px double black; border-collapse: collapse;
}\n\
     .my_table tr.header{border-bottom:3px double black;}\n\
     .my_table th {text-align: left;}\
 </style>"
 print "<table class=\"my_table\">"
}
NR == 1{
 print "<tr class=\"header\">"
 tag = "th"
}
NR != 1{
 print "<tr>"
 tag = "td"
}
{
 for(i=1; i<=NF; ++i) print "<" tag " width=\"" widths[i] "\">" $i "</" tag ">"
 print "</tr>"
}
END { print "</table>"}' dataset.txt > document.html

您在这里遗漏了引号 EOL 或输入错误的换行符:collapse;}