|
| |||||||||
| Tags: batch file, dos command, stringtokenizer |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| 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. |
|
#2
| ||||
| ||||
| 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. |
|
#3
| ||||
| ||||
| 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) );
}
__________________ Education, Career and Job Discussions |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |
| How to execute a save command in background from a batch file | Jo-Anne | Windows x64 Edition | 1 | 18-09-2009 05:45 AM |
| How Sleep command work on Batch file in Windows | afidelino | Technology & Internet | 3 | 08-07-2009 11: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 01:22 AM |