0
如何從Ruby on Rails的文本文件中刪除特定行?如何從Ruby on Rails的文本文件中刪除特定的行?
實施例:
1: CLEAR , "Clear"
2: APPROACH_DIVERGING , "Approach Diverging"
3: ADVANCE_APPROACH , "Advance Approach"
4: APPROACH_RESTRICTED , "Approach Restricted""
5: APPROACH2 , "Approach"
從上面的例子我想刪除第三線。
3: ADVANCE_APPROACH , "Advance Approach"
最後,它會顯示如下:
CLEAR , "Clear"
APPROACH_DIVERGING , "Approach Diverging"
APPROACH_RESTRICTED , "Approach Restricted""
APPROACH2 , "Approach"
你能更清楚你如何識別哪一行被刪除?它總是第3行,還是總是匹配特定的正則表達式,或者其他什麼? – sflinter 2011-02-02 13:25:26
動態我將獲得行值...從那個需要刪除特定行...行號將變化 – Jeyavel 2011-02-03 07:40:44