我有一个看起来像这样的文件部分:
awk中:修改CSV含头
Downtown
3/1/2013, 6A, 1 convertible to 2 bedroom apartment, tile bath, air conditioning, $3800
4/1/2013, 4C, One bedroom living room eat-in-kitchen, $3850
East Village
5/17/2013, 9M, STUDIO K'ETTE air conditioner TILE BATH, $2300
6/1/2013, 6H, Studio with tile bath and kitchenette with stone counters tops, $2600
SoHo
6/1/2013, 10B ,STUDIO KETTE air conditioner TILE BATH, $2400
(等)
我希望它转换为是这样的:
Downtown, 3/1/2013, 6A, 1 convertible to 2 bedroom apartment, tile bath, air conditioning, $3800
Downtown, 4/1/2013, 4C, One bedroom living room eat-in-kitchen, $3850
East Village, 5/17/2013, 9M, STUDIO K'ETTE air conditioner TILE BATH, $2300
East Village, 6/1/2013, 6H, Studio with tile bath and kitchenette with stone counters tops, $2600
SoHo, 6/1/2013, 10B ,STUDIO KETTE air conditioner TILE BATH, $2400
我不知道如何把这些部分的标题,并将它们移动到列,以便我有一个完整的描述表...我相信用awk最容易做到,但是有人可以提供一段代码,或者说明如何用awk(或者其他最合适的命令)来完成这个工作?
谢谢!
烨,这就是答案!我认为awk是去这里的路。不知道你可以在awk语句中设置一个变量 - 非常酷! – user1642475