Skip to content

Instantly share code, notes, and snippets.

@jbfink
Created May 3, 2011 15:21
Show Gist options
  • Save jbfink/953519 to your computer and use it in GitHub Desktop.
Save jbfink/953519 to your computer and use it in GitHub Desktop.
grep patterns for macids
file = File.read('list.txt')
file.scan(/\s[\S]{9}\s/)
array = file.scan(/\s[\S]{9}\s/)
array.each do |wtf|
# I cannot believe I did this....
# and it worked.
wtf.chop!.reverse!.chop!.reverse!
end
File.open('isolated.txt', 'a') do |write|
write.puts array
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment