#1 23 Aug 2006 05:53

//[T.0.P]//
Member
Registered: 12 Aug 2006
Posts: 50

Line Column reading limit?

I don't know much about how data files work as far as actually storing the data into binary, but how about the line column limit for variables?

What I'm referring to is when in particularly using the FOR /F loop. It seems that the token limit is 31, but the asterick will still get the rest of the value from the variable, no matter how many other tokens are left.

for /F "delims==; tokens=31*" %%g in ('set _varname') do echo.%%g %%h
:: %%g is a value and %%h is the rest of the variable's from the token point.

for /F "delims==; tokens=32" %%g in ('set _varname') do echo.%%g
:: for loop haults. does not echo %%g

for /F "delims==; tokens=32*" %%g in ('set _varname') do echo.%%g
:: variable set outputed, including variablename

Offline

#2 23 Aug 2006 19:30

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,031
Website

Re: Line Column reading limit?

Exactly, Ritchie Lawrence posted in alt.msdos.batch.nt a way to exceed that limit by nesting two or more FOR statements

His example assumes the delimiter is | and extracts the 78th field

the first FOR extracts token 31 + all the rest
the second FOR extracts token 62 + all the rest
the last FOR extracts the 16th token after #62 = 78

http://groups.google.com/group/alt.msdo … =&ie=UTF-8

Offline

#3 23 Aug 2006 19:50

//[T.0.P]//
Member
Registered: 12 Aug 2006
Posts: 50

Re: Line Column reading limit?

Great! Thanks for the link, Simon!

Offline

Board footer

Powered by FluxBB