Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Android strings.xml convert to csv fromat
#!/usr/local/bin/ruby
#
# Need "nokogiri" for xml parse
#
require "nokogiri"
file = File.open(ARGV[0])
xml_doc = Nokogiri::XML(file)
array = xml_doc.xpath("//string")
str = ""
array.each do |xpath_node|
str.concat( "#{xpath_node.attribute('name')}, #{xpath_node.text}\n")
end
puts str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.