Skip to content

Instantly share code, notes, and snippets.

@ipereziriarte
Created August 6, 2015 21:01
Show Gist options
  • Save ipereziriarte/896d79256d69c33df955 to your computer and use it in GitHub Desktop.
Save ipereziriarte/896d79256d69c33df955 to your computer and use it in GitHub Desktop.
Export Android Strings to CSV
#!/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