Solved Tokens and Delims

September 2, 2011 at 10:05:07
Specs: Windows XP
I am new to the forum so I apologize if this has already been answered. I am trying to figure out what tokens and delims are. I have gotten a general understanding from google but I cannot find a definitive answer or an understanding on how to use them. I am a complete noob when it comes to batch files, but I have been learning a lot from reading the posts on this forum. I figured it would be a great place to start asking questions. Thank you in advance for any help.

See More: Tokens and Delims

Report •

September 2, 2011 at 10:25:28
I have found some pretty good explanations since my earlier post. I am trying to create a simple time clock batch program. There is an admin panel that allows you to enter new employees and puts there name and number into a text file. The only thing that I am still stuck on is using tokens and delims to not allow the same employee number to be entered multiple times. Currently my format is name - number. It list each on a new line. Thanks again for any help

Report •

September 20, 2011 at 14:36:02
✔ Best Answer
A token is effectively how a line is broken up, so:

a b c d e f

these are tokens. So, if you were to use, say, a for loop and you wanted c (the 3rd token), you'd use this:

For /f "Tokens=3" %i in (<file name>) do <command> %i

Delims are basically the seperator chars, which are, by default, spaces, but you can have them as any, valid ASCII char.

If you post your code, I can give you a hand.

Report •

September 21, 2011 at 00:00:02
but you can have them as any, valid ASCII char.

Well almost any ASCII char


Report •

Related Solutions

September 26, 2011 at 10:18:09
I actually have been playing around with it for a bit now and I believe that I have it all figured out. Thank you both for your input though I am sure that some other users looking at the forum will be pointed in the right direction. Squirl I appreciate you offering your services and if I get stuck in the future I will definitely keep you in mind. Thanks again.

Report •

Ask Question