$1 != "comment" { print } $1 == "comment" { changed = substr($6, 0, length($6) - 1) printf("%s %s %s %s %s '%s';\n", $1, $2, $3, $4, $5, changed ) }