Last active
March 29, 2019 12:52
-
-
Save Pegolon/ffbcef3509b8852cbc70e69f2031663e to your computer and use it in GitHub Desktop.
Convert XML to YAML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/hash/conversions' | |
require 'yaml' | |
source_file_path='/path/to/file.xml' | |
target_file_path='/path/to/file.yaml' | |
File.write(target_file_path, Hash.from_xml(File.read(source_file_path)).to_yaml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment