function csv(text) { gsub(/"/, "\"\"", text) return "\"" text "\"" } BEGIN { FS = ";"; OFS = "," } { print csv($1), csv($2) }