嗨,我想解析一些数据,并将某些值替换为字符串,然后再保存到 CSV
Sample Lines
============
Time,11,Name,Jack,Cost,1300,Paid,1
Time,13,Name,Tim,Cost,1300,Paid,0
grep & cut (&awk)
============
grep -i "Time,\d+,Name,\w+,Cost,\d+,Paid" | cut -d, -f2 -f4 -f6 -f7 | awk (replace f7 with True if 1 or replace f7 with False if 0)
谢谢
编辑:修复了我的 grep。