Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parse Command file

 
Martinelli Simon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far? At what point in the problem are you stuck?
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mhm.
Some pseudocode:

Have a look at java.util.regex and String.replaceAll.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic