Solved

# how to parse a series of numbers in a file with DOS shell

Posted on 2011-02-18
868 Views
Have a file with integers delimited by a space like
10 11 13 14 15 17 18 19 31 41 42 51
53 54 56 59 60 ....

Can and how the numbers be looped? something like

for ....%%A ....   do (
...
@echo %%A
...
)

where %%A is one of the numbers. It loops all numbers. May not be in this way. Gurus, any tips will greatly appreciated.

0
Question by:jl66

LVL 51

Accepted Solution

Bill Prew earned 500 total points
ID: 34931326
If you just want each number one by one try this in a BAT file:

@echo off
for /F "tokens=*" %%A in (c:\ee\EE26833047\EE26833047.txt) do (
for %%B in (%%A) do (
echo %%B
)
)

~bp
0

Author Closing Comment

ID: 34931474
Thanks a lot.
0

## Featured Post

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

#### Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!