The basic idea is this:
I created test.txt and a txt file created with %date% in a directory, that is, in a format like this: 2008-07-31 Thursday.txt, but the problem is here: why can the code below only read the contents of test.txt, but not a long filename with spaces like "2008-07-31 Thursday.txt"?
set t=0
for /F "eol== tokens=1 delims= " %%a in (the problematic part) do (
set /A t+=%%a
)
echo %t%
What I originally wanted was to add up the numbers in the first column of the text file. If I change the problematic part to test.txt there's no problem, but if I change it to the text file in that date format, it doesn't work. Experts, please give me a hand...```
I created test.txt and a txt file created with %date% in a directory, that is, in a format like this: 2008-07-31 Thursday.txt, but the problem is here: why can the code below only read the contents of test.txt, but not a long filename with spaces like "2008-07-31 Thursday.txt"?
set t=0
for /F "eol== tokens=1 delims= " %%a in (the problematic part) do (
set /A t+=%%a
)
echo %t%
What I originally wanted was to add up the numbers in the first column of the text file. If I change the problematic part to test.txt there's no problem, but if I change it to the text file in that date format, it doesn't work. Experts, please give me a hand...```

