How to run a .awk file?

后端 未结 3 1866
轮回少年
轮回少年 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-04 00:07

    Put the part from BEGIN....END{} inside a file and name it like my.awk.

    And then execute it like below:

    awk -f my.awk life.csv >output.txt
    

    Also I see a field separator as ,. You can add that in the begin block of the .awk file as FS=","

提交回复
热议问题