How to run a .awk file?

后端 未结 3 1867
轮回少年
轮回少年 2021-02-03 23:19

I am converting a CSV file into a table format, and I wrote an AWK script and saved it as my.awk. Here is the my script:

#AWK for test
awk -F , \'
    BEGIN {
           


        
3条回答
  •  后悔当初
    2021-02-03 23:47

    The file you give is a shell script, not an awk program. So, try sh my.awk.

    If you want to use awk -f my.awk life.csv > life_out.cs, then remove awk -F , ' and the last line from the file and add FS="," in BEGIN.

提交回复
热议问题