Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-10-2009
Member
 
Join Date: Oct 2005
Posts: 81
stringtokenizer in batch file / dos command

Can anyone teach me how to perform or do a stringtokenizer in DOS Command or Batch File. What I want is a trick to split some sort of strings and then I want to iterate those each strings using the loop method. Thanks for any help.
Reply With Quote
  #2  
Old 14-10-2009
Member
 
Join Date: Dec 2007
Posts: 1,728
Re: stringtokenizer in batch file / dos command

Basically, the string tokenizer class allows an application to break a string into tokens. The tokenization method is much simpler than the one used by the StreamTokenizer class. The StringTokenizer methods do not distinguish among identifiers, numbers, and quoted strings, nor do they recognize and skip comments.
Reply With Quote
  #3  
Old 14-10-2009
Member
 
Join Date: Dec 2007
Posts: 1,592
Re: stringtokenizer in batch file / dos command

StringTokenizer in Java, here you go:
Code:
String cadenaPreguntas = request.getParameter(Keys.PREGUNTA_CADENA);
		//System.out.println("cadena de Preguntas" + cadenaPreguntas);
		StringTokenizer tokenizerPreguntas = new StringTokenizer(cadenaPreguntas, "||");
		String stringPregunta = "";
		while (tokenizerPreguntas.hasMoreTokens()) { 
		    stringPregunta = tokenizerPreguntas.nextToken();
		    
		    Pregunta pregunta = new Pregunta();
		    
		    StringTokenizer tokenizerAtributosPregunta = new StringTokenizer( stringPregunta, "##");
		    
		    // primero el texto de la pregunta
		    String textoPreg = tokenizerAtributosPregunta.nextToken();
		    if (!textoPreg.equals("")) {
			    pregunta.setTextoPregunta( Utilities.esNulo(textoPreg) );
		    }
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "stringtokenizer in batch file / dos command"
Thread Thread Starter Forum Replies Last Post
How to work with if command and batch file kolton Operating Systems 5 01-12-2010 12:09 AM
Batch halts on last command Indrani Operating Systems 2 25-07-2009 09:29 PM
How Sleep command work on Batch file in Windows afidelino Technology & Internet 3 08-07-2009 10:42 AM
Can We check the exit command in the batch file Dhruv Software Development 3 30-12-2008 11:56 PM
Fast User Switching via Command Line or Batch File? Woody45 Vista Help 1 18-03-2007 12:22 AM


All times are GMT +5.5. The time now is 01:58 PM.