Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.parse file
- File.open(file){|io|
- url = nil
- text = nil
- next_is_text = false
- io.each_line{|line|
- if url == nil
- url = s.match(/Recno::\s+(.*)/)[1] rescue nil
- end
- if text_is_next
- text = line
- text_is_next = false
- end
- if text == nil
- text_is_next = true if s.match(/ParseText::/)
- #parsetext is the next line
- end
- if url && text
- puts url
- puts text
- url = nil
- text = nil
- end
- }
- }
- end
Add Comment
Please, Sign In to add comment