我有一個看起來像這樣的文件部分:
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