Code Monkey home page Code Monkey logo

z5lltoxml's Introduction

z5llToXML

Tools for converting ZipInfo.com z5ll.txt and zcugoem.txt files to Salesforce Commerce Cloud* (SFCC) Geolocation XML format files. (*formerly known as Demandware)

Dependencies

Usage

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 Have Trouble Executing

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.

Roadmap

  1. Currently the script can use several megabytes of RAM and ideally will be converted to perform progressive writes to the output file rather than storing the entire XML document in system memory. One way it currently attempts to deal with this issue is to (in bad form) trigger garbage collection after every 1000 rows processed. This helps keep the program from eating up too much RAM and causing severe slowdowns.

Update: This was resolved in 1.1a when we switched to libxml-ruby rather than using REXML for XML writing.

z5lltoxml's People

Contributors

sholsinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.