Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- words = IO.binread("text-split.txt")
- map = {
- "WORD1" => "0",
- "WORD2" => "0",
- "WORD3" => "1",
- "WORD4" => "1",
- }
- IO.binwrite("output.txt",words.split(" ").each.inject("") { |out,n| out << map[n] })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement