0

我在文本文件中有大量城市,但只需要提取城市。

这是格式:

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

是否可以仅提取城市并通过命令行将它们输出到另一个文件?

谢谢!

4

1 回答 1

2
awk '{FS=","; print $2}' < file
于 2012-11-11T08:39:09.930 回答