2015-09-24 240 views
2

第一列我有以下文件,這些行:刪除從文本文件

"A,B,C,D","E","F","G","H" 

我怎樣才能輕鬆地刪除第一列配額?

最後,我想看看:

"E","F","G","H" 
+0

它始終是固定的第一列或者也需要刪除其他列?像第38列,第5列等? – Kent

回答

0

嘗試這種方式也

sed 's/^"[^"]\+",//' FileName.txt 

輸出:

"E","F","G","H" 
2
sed 's/^"[^"]*",//' YourFile 

假設:

  • 有雙引號字符串沒有\"
  • 場均雙引號(事實上,至少第一一個)
  • 字段值和之間沒有額外的空間(容易在這種情況下,以適應)
0
awk -F'[",]' -v OFS=\",\" '{print "\""$5,$6,$7,$8"\""}' file 

"E","F","G","H"