Giter Site home page Giter Site logo

datamerge's Introduction

Data sorting and filtering

Read the 3 input files reports.json, reports.csv, reports.xml and output a combined CSV file with the following characteristics:

  • The same column order and formatting as reports.csv
  • All report records with packets-serviced equal to zero should be excluded
  • records should be sorted by request-time in ascending order

Additionally, the application should print a summary showing the number of records in the output file associated with each service-guid.

Please provide source, documentation on how to run the program and an explanation on why you chose the tools/libraries used.

Submission

My submission was build with Apache Maven.

The project contains 4 Java classes:

  1. DataMerge - The main executable class that handles data merging, filtering, and sorting.
  2. Report - Contains builder and other methods associated with individual report entries.
  3. FileReader - Methods for reading CSV, JSON, and XML reports files.
  4. FileWriter - Methods for writing reports to a CSV file.

Two external libraries were used to streamline file I/O:

  1. Apache Commons IO - 2.11.0

The commons-io library is used in the project for writing data to a CSV file. I chose this library becuase it had great documentation, comes from a trusted publisher, and is one of the most popular IO Java libraries.

  1. Org.Json - 20220320

This project uses the org.json library for converting strings read from CSV, JSON, and XML files into JSON objects and JSON arrays. The JSON data created using the library simplifies data merging and parsing into Report instances. I chose this library due to its simple implementation, lack of external dependencies and because it is consistently maintained/updated.

Installation

Clone this repository to your target directory with:

git clone [email protected]:gregolive/datamerge.git

Usage

  1. From IDE (IntelliJ IDEA shown)

Launch the project in an IDE from the /solution directory and open the DataMerge.java class from within /src/main/java.

Click run and the program will print the packets-serviced data to the deployment console.

Locate the mergedReports.csv output file at /src/main/resources.

run program from IDE

  1. From Command Line/Terminal

Navigate to the solution directory within the datamerge project folder.

Run the program with:

java -jar out/artifacts/solution_jar/solution.jar

The program will print the packets-serviced data to the open CLI and save the mergedReports.csv output file to /src/main/resources.

run program from command line

datamerge's People

Contributors

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