Add double quotes around fields in AWK script output?

前端 未结 6 1417
臣服心动
臣服心动 2021-02-04 01:33

I have written an awk script that converts a distributor flatfile into a CSV importable into Magento. This file is semi-colon delimited.

It is not putting quotes around

6条回答
  •  太阳男子
    2021-02-04 02:18

    If you want:

    add this to the existing script.

    You can insert additional \"\" in each argument of print like this:

    print "\"admin\"", "\"base\"", ...

    Edited:

    Yes, perhaps seting OFS is better solution:

    BEGIN { OFS="\";\""; } ... print "\"admin", ...., "simple\"";

提交回复
热议问题