Created
January 27, 2010 20:36
-
-
Save ebot/288132 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby -wKU | |
require "rexml/document" | |
require 'FileUtils' | |
include REXML | |
# Update the xml | |
Dir.glob( "./*.bafxml" ) do |batch_file| | |
puts batch_file.to_s | |
doc = REXML::Document.new File.new( batch_file, 'r' ) | |
XPath.each( doc, "//BatchAcqList/BatchAcq/OwnerList/Owner[@OwnerTypeName='BRAVOHEALTHF']/Label" ) do |object| | |
puts " #{object.name}" | |
object.name = 'label' | |
puts " NOW = #{object.name}" | |
end | |
# Save the doc | |
o = File.new( batch_file, 'w' ) | |
doc.write( o, 0 ) | |
o.close | |
puts " Saved" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment