This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Using multiple command line arguments to open multiple files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using multiple command line arguments to open multiple files" Watch "Using multiple command line arguments to open multiple files" New topic
Author

Using multiple command line arguments to open multiple files

Jack Sloan
Greenhorn

Joined: Mar 23, 2011
Posts: 11
Hey guys, I am trying to get the hang of CommandLine arguments and am trying to use two at a time say fro instance where I put two files in and I want my program to open both and collect statistics about it.
This is what I have.
How can I make it so two or more filenames can be added to this and then print out the results?
Thanks
Edwin Torres
Ranch Hand

Joined: Mar 19, 2011
Posts: 37
Notice that the args parameter of main() is an array:

When you pass arguments in on the command line, they are placed into that args array. So if your command line is this:

java ProcessText one two three

Then your args array will look like this:

{ "one" , "two" , "three" }


Follow me: @CompGuyProbs
Read me: Freehold Computers Examiner
Jack Sloan
Greenhorn

Joined: Mar 23, 2011
Posts: 11
Thank you I got it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using multiple command line arguments to open multiple files
 
Similar Threads
How to call a UNIX script froma java application on AIX (using Korn shell)?
Compare two directories
Why declaring a variable as string?
file is empty, will fail
Question on XSLTInputSource and NetBeans IDE 3.5.1