This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Parse Command file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Parse Command file" Watch "Parse Command file" New topic
Author

Parse Command file

Martinelli Simon
Greenhorn

Joined: Mar 20, 2006
Posts: 1
Hi all,

I have a command-file that looks like that:



What I like to do is to parse the file and get back a String with the call of javaw that you see in the last line. All variables sourrounded by % should be subsitutet.

Thanks for your help.

Regards, Simon
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
What have you tried so far? At what point in the problem are you stuck?


Fun programming etcetera!
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
I'm sure it's possible in Java (at least in those versions that allow you to access system environment variables), but Java doesn't sound like the best language for this, as it doesn't know anything about the NT shell. Is there some reason you have to use Java? Could you consider using NT command script, Perl, Python...?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

mhm.
Some pseudocode:

Have a look at java.util.regex and String.replaceAll.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parse Command file
 
Similar Threads
question about weblogic 6.1
Intermediate/Advanced Java Users. Pl help with static profilers (PMD)
Modifying existing jar file, how?
Unable to Start JINI lookup server
Problem in setting up Classpath variable in Win ME