Discussion Locked

NT Shell Scripting Question

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

This may be a bit too arcane - but I'll even cite page and paragraph of Tim Hill's book (Windows NT Shell Scripting) for this one.

On page 136 - the troubleshooting tip states that you must explicitly specify the tab character to use tab seperated tokens in the following command:

for /F "tokens= 1,2,3 delims=???? skip=4" %%I in (\\%logserver%\%logpath%\sclist_temp.txt) do echo %%J >> \\%logserver%\%logpath%\temp.txt

Specifically - he states "Follow the = sign with a single tab character."

We have tried:
x9,x09,x009,/x9,/x09,/x009,^i,^I,/u0009,HT,TAB,/t,/T,/cI as well as just hitting tab. I have found no reference to a code that shell scripts will recognize as a TAB character.

Anyone know what I am talking about here ? Iam trying break a line in a text file into tokens using TAB as a delimiter.

8 replies

by coding_is_cool

No dice - it then tries to use "t" as a delimiter - perhaps it thinks the delimiters are / and t.

If you use the utility sclist.exe (rez kit I think) - and pipe it to a text file - you will see what I am trying to parse. Prob is that when I don't set delims - it will see the spaces between Service Names (ie Cold_Fusion_Server) and make each word of the service a token - instead of pulling the entire service name as one token. I am not even sure if a tab character is what I need - I just need to figure out how to break up this data. Three columns - and I need the middle column, but that middle column has data that may be several words seperated by spaces. The columns are left justified - so they are always so their width is always the same - is there a way to step over x amount of spaces ?

I really found this section of the book weak - I guess I am supposed to know what those delimiters are and how to parse text files ?

by pvp

I keep seeing forward slashes in your messages. It requires backslash.

by james_randy

If you are still tackling this problem, perhaps you should consider calling your local super-hero.

This discussion is closed to new replies.