Coder Social home page Coder Social logo

csv-loader's Introduction

csv-loader

A tool to load csv file data into List/Stream of Objects

How to Use

1. Create an interface with getter methods for the fields you want to extract from the csv file. No implementation of the interface required.

		public interface Employee {

			@FieldIndex(0)
			public long getEmployeeId();
			
			@FieldIndex(1)
			public String getFirstName();
			
			@FieldIndex(2)
			public String getLastName();
			
			@FieldIndex(3)
			public double getCTC();
			
			@FieldIndex(4)
			public boolean isPermanent();
			
			@FieldIndex(5)
			public char getGrade();
			
			@FieldIndex(6)
			public Date getLastSeen(Parser<Date> parser);
			
			@FieldIndex(7)
			public int getExperience();
			
		}
	
2. Mark the methods with **@FieldIndex** with 0 based index of the field in the csv file. 

3. Create an instance of CsvLoader class using its Builder.

4. Use one of the overridden methods to load the data in your csv file into List or Stream of Objects of your interface type.

5. Bingo!!! You are ready to operate on your csv data. 

csv-loader's People

Contributors

sudhanshu-g avatar

Stargazers

Manivel Thiruvengadam 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.