GithubHelp home page GithubHelp logo

datamerge's Introduction

Data Merge

Implementation of datamerge @kyleboyle

An interface is created to handle the reading(optionally writing too) of reports in different formats. 3 implementations are provided to handle the reading of json, xml and csv reports. These implementations are injected to com.jobinbasani.DataMergeProcessor which will invoke them to generate the final list of records.

The final output merges records from all files, removes entries where packets-serviced equal to zero, and sorts them by request-time in ascending order

Implementation is not coupled to filenames, directories etc. By default it looks in the current directory for suitable files, but you can pass arguments to specify the location of reports and the output file path.

Libraries used

  • args4j - makes it easy to parse command line options/arguments
  • logback - for logging
  • opencsv - for reading and writing csv files
  • jackson - for parsing both json and xml files
  • JUnit 5 - for testing

Execution

Run below maven command to compile and package the application.

mvn clean package

This will create a runnable jar file in target folder. Alternatively, you can run the application with maven itself

mvn exec:java

This will execute the application using the default options - it will look at the current directory to parse the report files. To pass the source directory and output file location, use the below example command.

mvn exec:java -Dexec.args="-source /Users/username/Desktop/reports -output /Users/username/Desktop/output.csv"

Replace the -source and -output with correct values.

Use the -csvheaders option to specify different headers in the output csv file.

Additionally, you can execute the com.jobinbasani.DataMergeRunner class directly too. The -source and -output arguments can be passed here too. After execution, it prints a summary that groups the records by Service GUID and shows the number of records associated with it.

jobinbasani.com

datamerge's People

Contributors

jobinbasani avatar

Watchers

 avatar  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.