Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.05 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.05 KB

SortCsv

Sorts efficiently the csv file based on one of its columns

Consider a CSV input file.

  1. Design a program which sorts efficiently the csv file based on one of its columns. The program should never have more than x number of lines in memory

  2. Implement the above program using java, single thread

  3. Input parameters: a. path to the input file. You can assume that there are no additional files in the folder with the input file

    b. column number

    c. max number of lines in memory

Importent

  • Please set up a a scr folder as a Sources Root folde and resources folder as a Resources Root folder
  • Before the next run either delete or empty output folder

How to run

  • Put any .csv file into the resources folder or use the pre-defined data.csv file
  • Run the application
  • Find the sorted file at output folder

Configuration

You can change the following in configuration.properties file in resourse folder:

  • The path for the initial CSV file
  • Column number to perform the sort operation
  • Maximum number of lines in memory