File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command line arguments via (string[] args)

 
Matt Moore
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I've been told that you can pass a text file to be inputted via the (String[] args) part of the main method.

eg.

java someprogram someinput.txt

Well thats what I'd like to do, how do I do it?

thanks,

Matt
 
Mike Gershman
Ranch Hand
Posts: 1272
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This assumes the file is in the same directory as someprogram, otherwise you have to specify the path.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic