Results 1 to 2 of 2
Thread: Parsing Argument Values
- 02-15-2008, 04:41 AM #1
Member
- Join Date
- Feb 2008
- Posts
- 2
- Rep Power
- 0
- 03-06-2008, 11:01 AM #2
Member
- Join Date
- Nov 2007
- Posts
- 11
- Rep Power
- 0
Hi,
You can improve the code below and use. This is just indicative.
But an elegant way to do this would be to use one of the open source command line frameworks like Apache Commons.Java Code:public class ParseOptions { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String input_file = args[0].split("=")[1]; String dest_dir = args[1].split("=")[1]; System.out.println("input_file "+input_file); System.out.println("dest_dir "+dest_dir); } }
HTH
Similar Threads
-
Command line argument
By denisatandi in forum New To JavaReplies: 8Last Post: 10-16-2012, 11:37 PM -
Accessing boolean Values of another values in one class.
By a_iyer20 in forum Advanced JavaReplies: 4Last Post: 04-15-2008, 01:04 PM -
How to resolve Constructor argument in Spring
By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 12:43 PM -
Parsing Argument Values
By vipvan2000 in forum Advanced JavaReplies: 1Last Post: 02-17-2008, 01:41 AM -
How to resolve Constructor argument in Spring
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:34 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks