| 1. |
Solve : Question about tokens and delimeters? |
|
Answer» I'm just curious about something I couldn't find any more information about.
I'm not clear on your question but that is correct. The spaces and commas are treated as separators up the the start of the third term, which starts with just The * means "put the rest of the line into the next variable" If it's unclear then explain what you expected, or what you need it to look like. Example from help for FOR command. Quote FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do echo %i %j %k From that example, as said, %k variable displays all the remaining tokens. I'm not sure why the delimiters are not applied to the remaining tokens after the variable (%k). As it's stated from that example that the variable %k stands for ALL following tokens, not just the rest of the line. The delimiters are only applied to the given tokens (2,3) while the wildcard that represents all the remaining tokens is ignored. I hope this clarifies my question a BIT more. Quote from: Night on August 10, 2014, 10:26:06 AM it's stated from that example that the variable %k stands for ALL following tokens, not just the rest of the line. As you have FOUND, the variable %k stands for the rest of the line, that is, any remaining tokens and separators all together. The help documentation could be clearer in EXPLAINING that, I suppose, (it can be occasionally opaque or seemingly incomplete) but you have discovered by experiment the way it works. Quote the wildcard that represents all the remaining tokens is ignored. It is not "ignored". It is correctly interpreted. The asterisk ("wildcard") represents the whole remainder of the line. There are no more "tokens" to process. Thanks for the clarification! I guess the documentation isn't all that good after all. That would be all. |
|