Skip to content

Commit

Permalink
Create MainCsv.java
Browse files Browse the repository at this point in the history
  • Loading branch information
rac021 authored Nov 6, 2016
1 parent d1e9e26 commit cb9679b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/main/java/MainCsv.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

import org.inra.yedodba.ProcessorCsv;

/**
*
* @author ryahiaoui
*/

public class MainCsv {

public static void main(String[] args) throws Exception {

String directory = "" , outFile = "" , ext = "" , csv = "" ;

int nbParams = 0 ;

for ( int i = 0 ; i < args.length ; i++ ) {

String token = args[i] ;

switch(token) {
case "-d" : directory = args[i+1] ; nbParams += 2 ;
break ;
case "-out" : outFile = args[i+1] ; nbParams += 2 ;
break ;
case "-ext" : ext = args[i+1] ; nbParams += 2 ;
break ;
case "-csv" : csv = args[i+1] ; nbParams += 2 ;
break ;
}
}

ProcessorCsv processor = new ProcessorCsv() ;

if( nbParams < 8 ) {
System.out.println ( " missing parameters " ) ;
return ;
}

if(directory.isEmpty() || outFile.isEmpty()) {
System.out.println (" directory or outFile is Empty " ) ;
return ;
}

if(ext.length() == 0 ) ext = ".graphml" ;

long startTime = System.currentTimeMillis() ;
processor.entryProcess(directory, outFile, ext, csv ) ;
long executionTime = System.currentTimeMillis() - startTime ;
System.out.println(" Elapsed seconds : " +
executionTime / 1000 + " s" ) ;
System.out.println(" ") ;
}
}

0 comments on commit cb9679b

Please sign in to comment.