Hello TechKnow members and visitors!
I needed a simple functions to cut / divide a text string using batch for work.
So I've come up with this little simple script:
if "%1"=="" echo NO INPUT FOUND! && goto :EOF
REM get first character from tmpX
REM remove first character from tmpX
REM actions for character
echo chardivider output: %char%
REM Loop until the string terminator is reached in tmpX
IF NOT "%tmpX%" == "%strterm%" GOTO :STRINGCUTTER
A little note, it uses a "_" character to terminate the command, if your data contains this character, be sure to use another terminator.