| Path: | news2.ip-mobilphone.net ! NNTPLoader.ip-mobilphone.net ! text.usenetserver.com ! out02a.usenetserver.com ! news.usenetserver.com ! in02.usenetserver.com ! news.usenetserver.com ! postnews.google.com ! a70g2000hsh.googlegroups.com ! not-for-mail |
| From: | b.pedersen@get2net.dk |
| Newsgroups: | alt.msdos.batch.nt |
| Subject: | Maybe a new one for Timo's FAQ :). Complete bug free. No exe, No redirecting... |
| Date: | Tue, 18 Mar 2008 22:06:30 -0700 (PDT) |
| Organization: | http://groups.google.com (Who's computer is this?) |
| Lines: | 42 |
| Message-ID: | <6fab22aa-75b8-4bd0-b3e6-b2c8599a15b0@a70g2000hsh.googlegroups.com> |
| NNTP-Posting-Host: | 62.107.148.10 |
| Mime-Version: | 1.0 |
| Content-Type: | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: | 7bit |
| X-Trace: | posting.google.com 1205903191 13717 127.0.0.1 (19 Mar 2008 05:06:31 GMT) |
| X-Complaints-To: | groups-abuse@google.com |
| NNTP-Posting-Date: | Wed, 19 Mar 2008 05:06:31 +0000 (UTC) |
| Complaints-To: | groups-abuse@google.com |
| Injection-Info: | a70g2000hsh.googlegroups.com; posting-host=62.107.148.10; posting-account=kdV1CQkAAAAag6uMlIbsjbiSLkW6VrYb |
| User-Agent: | G2/1.0 |
| X-HTTP-UserAgent: | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) |
| X-Received-Date: | Wed, 19 Mar 2008 00:06:31 EST (text.usenetserver.com) |
| Xref: | news2.ip-mobilphone.net alt.msdos.batch.nt:36101 |
@echo off& setlocal enableextensions enabledelayedexpansion
call:nx "Hello((test001))4589076.." "4"
echo %nx% would say 4589 because the 4 first continuous numb are 4589
call:nx "Hello((test002))4589076.." "4" "last"
echo %nx% would say 9076 because the 4 last cont numbers are 9076
call:nx "Hello((test003))4589076.." "8"
echo "%nx%" would say "" because there are not 8 cont numbers
call:nx "test4 2829...8455" "3"
echo %nx% would say 282
call:nx "test5 2829...8455" "3" "last"
echo %nx% would say 455
pause
exit /b
_______________
Benny Pedersen,
www.fineraw.com
_______________
:nx *[str] *[numb] *[]
set s=%~1& if defined s set s=!s:^)=]!& (set s=!s:^(=[!)
if "%~3"=="" (goto nx_L)else (set nx=)
: rvrs
if defined s (set nx=!s:~,1!%nx%& set s=!s:~1!& goto rvrs)else (
set s=%nx%)
: nx_L
if not defined s set nx=& exit /b 1
set /anx=%~2-1& for /L %%2 in (0,1,!nx!) do for /L %%9 in (0,1,9
) do if "%%9"=="!s:~%%2,1!" set /anx-=1
if %nx% lss 0 (
if "%~3"=="" (set nx=!s:~,%~2!)else (set /anx+=%~2& (
for /L %%2 in (0,1,!nx!
) do set nx=!s:~%%2,1!!nx!)& set nx=!nx:~,%~2!)
set s=& exit /b 0)
set /anx+=1
set s=!s:~%nx%!& goto nx_L