word = ARGV.shift File.open( ARGV.shift, 'r' ) do |in| File.open( ARGV.shift, 'w' ) do |out| in.each do |line| if line.chomp! == word out.puts line end end end end
Just do that in Perl and Bob's your paternal male sibling.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Search for a string in a file
by Fletch
in thread Search for a string in a file
by Millan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |