How do I do this im terrible at Batch???
Posted: 12 Aug 2007 20:37
How do I get the number of s in file.txt?
Full File:
echo/%f|findstr /b /c:"%ref_no%" >nul
if not errorlevel 1 (
echo/%f%s >>file.txt
) else echo/%f >>file.txt
)
echo :: How many times you used s in file.txt
FindStr /B /C:s file.txt | Find /C "s"
ping -n 2 127.0.0.1>nul
echo :: Done.
ping -n 2 127.0.0.1>nul
pause
and in file.txt lets say u say
s
s
s
It should come up in batch like this.
echo :: How many times you used s in file.txt
3
3<<< ??Now how do I get this number in a .txt file from batch file??
I know how to do
echo/%f|findstr /b /c:"%ref_no%" >nul
if not errorlevel 1 (
echo/%f%s >>file.txt
) else echo/%f >>file.txt
)
It must have something to do with echo/%f%s >>file.txt But what? Maybe a Professional will help me.
Thank You
Jessica
Full File:
echo/%f|findstr /b /c:"%ref_no%" >nul
if not errorlevel 1 (
echo/%f%s >>file.txt
) else echo/%f >>file.txt
)
echo :: How many times you used s in file.txt
FindStr /B /C:s file.txt | Find /C "s"
ping -n 2 127.0.0.1>nul
echo :: Done.
ping -n 2 127.0.0.1>nul
pause
and in file.txt lets say u say
s
s
s
It should come up in batch like this.
echo :: How many times you used s in file.txt
3
3<<< ??Now how do I get this number in a .txt file from batch file??
I know how to do
echo/%f|findstr /b /c:"%ref_no%" >nul
if not errorlevel 1 (
echo/%f%s >>file.txt
) else echo/%f >>file.txt
)
It must have something to do with echo/%f%s >>file.txt But what? Maybe a Professional will help me.
Thank You
Jessica