-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(" ") ; | ||
} | ||
} |