Skip to content

Instantly share code, notes, and snippets.

@vidmantas
Created June 23, 2010 15:34
Show Gist options
  • Save vidmantas/450090 to your computer and use it in GitHub Desktop.
Save vidmantas/450090 to your computer and use it in GitHub Desktop.
f = File.read("9niwrHXd.txt")
f.split("<url>").each do |e|
f.gsub!(e, '') if e =~ /aspx\?/
end
f.gsub!(/(<url>){2,}/, "<url>")
File.open("new.txt", "w") do |n|
n.write f
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment