Created
December 1, 2016 00:12
-
-
Save jamiecook/ce1008dd2de43b0aa976838bf57b0dfa 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
list_of_files = IO.readlines(ARGV[0]) | |
def process_file(file, from, to) | |
layer_name = File.basename(file).gsub(/.tab/i, '') | |
cmd = "d:/bdk/bedrock/resources/gdal/ogrinfo \"#{file}\"" | |
cmd += "-sql \"ALTER TABLE #{layer_name} RENAME COLUMN #{from} TO #{to}" | |
`#{cmd}` | |
end | |
list_of_files.each { |file| | |
process_file(file, 'CapB_A', 'Cap_BA') | |
process_file(file, 'CapA_B', 'Cap_AB') | |
process_file(file, 'LTB_A', 'LT_BA') | |
process_file(file, 'LTA_B', 'LT_AB') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment