Git Product home page Git Product logo

java-file-processor's Introduction

GitHub

java-file-processor

Solution Design

This solution has been broken into 6 core extendable components.

  • Main Processor

It is the entry point for the whole file processing solution which receives command line arguments & then instantiates high level objects like Reader, Extractor, Writer based on provided input & hand over controls when needed. It has no processing logic at all.

  • Writer

Writes final output to STDOUT or a File based on configurable inputs

  • File Reader

Reads file in lazy manner into memory, once a line is read for a specific segment in current use case PID, then it hands over to Extractor to process further.

  • Extractor

Once a line is read then it splits all data items based on delimiter & extract positional data items in current scope (Name, DoB, Gender). Once extracted it hands over to Formatter & Validator to process it further

  • Formatter

Formats data based on configurable search indicator whether raw data needs formatting or not. It makes use of Validator to validate each data item.

  • Validator

Validates data attribute as per Optionality defined in requirement sheet & along with basic length & character type checks. It also formats the date field & gender field to a more human readable format.

programming-excercise (3)

Build Library Locally

$ mvn clean install

Testing via Java layer

 Usage : $$java -jar java-file-processor-<version>.jar <path to file> <Segment Identified {allowed only PID for now}> <formatSearchResult {allowed only true or false (default=true)}> <writeToFile {allowed only true or false(default=false)}>
 e.g.; TO Process PID Segment with formatted search result : $ java -jar java-file-processor-1.0-SNAPSHOT.jar PID /mydir/files/file.txt true

Testing via Shell Script layer

 Usage : $ ./pid-file-processor.sh  <path to file> <formatSearchResult {allowed only true or false}> <writeToFile {allowed only true or false(default=false)}>
 e.g.; TO Process PID Segment with formatted search result & write to File : $ ./pid-file-processor.sh /mydir/files/file.txt true true

java-file-processor's People

Contributors

subratamazumder avatar

Watchers

 avatar  avatar

java-file-processor's Issues

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.