Originally posted by bjsh at 2007-5-1 05:16 AM:
Spent some time to write this..
Result: 24691356902469134
Brother bjsh:
I accidentally saw your post and was impressed by your code. I spent more than a day reading your code and just now understood the part of extracting numeric fields. I'm a newbie, don't laugh at me, haha. I have some questions to ask.
It feels that your regular expression of findstr can also match cases like "12345adfadfds45156" (both ends are numbers but the middle is characters). I want to change it to this:
findstr "^*$" tmp.txt
There is a parameter /r in your findstr. I didn't see this parameter when I checked the help of findstr in the command line. I tried the cases with and without /r respectively and didn't see any difference. What is the function of that /r?
Note: The regular expression "^*$" cannot match cases like "123457684 ", so the code in the get_number section needs to be slightly modified. My suggestion is as follows:
Original code: echo %1 >>tmp.txt & shift
Modified: echo %1>>tmp.txt& shift ::Note that there should be no spaces after %1 and after .txt here, otherwise the spaces will be input into .txt and affect the matching of the regular expression.
Or change to: echo %1>>tmp.txt
shift
