Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のような行を持つファイルがあるような要件があります
424: Josh 1273: Sara Keith 141: Shefali 990: Lang 849: Broc Benedict 566: Victoria 283: Karla Mateos
(IDと名前)。paramsで名前を取得したら、一致する行を開いて削除する必要があります。ファイルとgrepの一致する行を開いて、簡単な方法で削除することはできますか?
Fileファイル操作に役立つrubのクラスがあります。同様の問題はここで答えられます。
File
ファイルテキストでパターンを検索し、それを特定の値に置き換える方法