Tools for converting ZipInfo.com z5ll.txt files to Salesforce Commerce Cloud (SFCC aka Demandware) Geolocation XML format files.
Tools for converting ZipInfo.com z5ll.txt
and zcugoem.txt
files to Salesforce Commerce
Cloud* (SFCC) Geolocation XML format files. (*formerly known as Demandware)
To setup dependencies you must run the following command:
$ bundle install
To convert a file from ZipInfo.com’s CSV format into an importable SFCC Geolocation
XML file is as simple as running the following command:
$ ./z5llToXML.rb /path/to/z5ll.txt
You can also convert multiple files at once:
$ ./z5llToXML.rb /path/to/z5ll.txt /path/to/another/z5ll.txt
Some files contain multiple country postal codes. If your file contains multiple codes
such as the zcugoem.txt
file that contains both US & CA postal codes. Simply use the
-c
or --country
flag to specify the country codes that are in the file(s). Currently
z5llToXML supports only US & CA.
$ ./z5llToXML.rb -c US,CA /path/to/zcugoem.txt
If you’re having issues running this script in your native environment, I
recommend using (rvm
)[https://rvm.io/] with Ruby version 2.1.2 which this
script was written against. Here’s an example of the commands to run once
you’ve installed rvm.
$ rvm install ruby-2.1.2
$ rvm use ruby-2.1.2
$ gem install bundler
$ bundle install
$ ruby ./z5llToXML.rb /path/to/z5ll.txt
This should resolve any issues you’re having with mismatched Ruby, gems, or
problems requiring specific gems.
Update: This was resolved in 1.1a when we switched to libxml-ruby rather than using
REXML for XML writing.