Command line argument help...
I need help with specifying multilple file names on the command line to proccess passages in each of them in order All in one run... Each passage(file) has to be processed separately with the output for the different tasked independent of the other passages.. Meaning, process the first passage and produce the required output, then process the second passage and so on..
For example, the two files that i wanna read in on the command line is called p2p.txt and google.txt
How i would read in only one is something like: java project p2p.txt
How do i process both?
Code:
// Check for existence of the file
File infile = new File(args[0]);
if(!infile.exists())
{
System.out.println("The file" +args[0]+ "does not exists.");
System.out.println("Quitting now. Please try again.");
System.exit(1);
}
Also, how do lose the precision on something like: Code:
(prepositions_count[i]/(double)num_words)*100);
or
Code:
(biagrams_count[i]/(double)num_biagrams)*100);
Where something like 5.400981996726677 becomes 5.4?