如何用SHELL正确分割CSV文件中的列

2025-03-23 12:25:37
推荐回答(1个)
回答1:

2种方法:

#方法1:
awk -F, '{print $1","$4","$7}' no1/test.csv no2/test.csv no3/test.csv > newtext.csv
#方法2:
cat no1/test.csv no2/test.csv no3/test.csv | cut -d, -f1,4,7 > newtext.csv