• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Command LIne Arguments

 
Greenhorn
Posts: 26
Firefox Browser Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


How to change command line argument delimiter spacer instead of any other delimiters?

advance thanks
sasikumars
 
Ranch Hand
Posts: 237
MyEclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't know about source code change is possible.
i think that is not possible.

why don't you add all command line arguments to a single string and then split that string with the desired delimiter.

 
ssasi kumar
Greenhorn
Posts: 26
Firefox Browser Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sidheer,

Thanks for your reply. now am working java trainee in one mnc company. so that commandline arguments program concept is my task .my team leader told not gave a string input.


thanks for reply...
with regards,
sasikumar..
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The parsing of all command line arguments into the String[] is done by the shell (Command Prompt for Windows). You would need to change that in order to do what you want, but as far as I know that's not possible in Windows, and at the very least tricky on UNIX / Linux.

Sudheer's workaround would work - you turn all the separate command line arguments into one large argument (by quoting it; don't forget to escape any existing quotes). This will then be sent to the JVM as a single-element String[] to the main method. You can then do with it whatever you want.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic