Delimited by comma using AWK or SED with the tags below

前端 未结 1 880
慢半拍i
慢半拍i 2021-01-29 10:54

Delimited by comma using AWK or SED with the tags used below:

[BEGIN AccountID]
        [BEGIN CallerID]
            [BEGIN Billed Account Attributes]
                   


        
相关标签:
1条回答
  • 2021-01-29 11:38

    This might work for you (GNU sed):

    sed '/\[BEGIN AccountID\]/,/\[END AccountID\]/!d;/\[BEGIN AccountID\]/{h;d};/./H;/\[END AccountID\]/!d;g;s/\n*\[[^\n]*\n*//g;s/\n/,/g;s/\s*//g;ta;:a;s/,//9;t;s/$/0,0,0/' file
    

    N.B. This removes spaces and blank lines.

    0 讨论(0)
提交回复
热议问题