我在文本文件中有大量的城市列表,但只需要提取城市。
以下是格式:
Country,City,AccentCity,Region,Population,Latitude,Longitude
ad,aixas,Aixàs,06,,42.4833333,1.4666667
ad,aixirivali,Aixirivali,06,,42.4666667,1.5
ad,aixirivall,Aixirivall,06,,42.4666667,1.5
ad,aixirvall,Aixirvall,06,,42.4666667,1.5
是否可以只提取城市并通过命令行将它们输出到另一个文件?
谢谢!
答案 0 :(得分:2)
awk '{FS=","; print $2}' < file