break a string into lines

June 21, 2011 at 09:05:09
Specs: Windows XP
break a string into lines
string size specified by myself 6 as example
111111111111111111111111111111111111111111111111111111
into
111111
111111
111111
111111
etc ....

See More: break a string into lines

Report •

#1
June 21, 2011 at 09:37:49
This is the last of your games I do solve since I am bored kidding.

@echo off & setlocal EnableDelayedExpansion
set string=XXXXXXXXXXXXXX
set ln=6
set pos=0

:LOOP
set line=!string:~%pos%,%ln%!
echo.%line%
set /A pos+=%ln%
if  not "!string:~%pos%,1!"=="" goto :LOOP


Report •

#2
June 21, 2011 at 12:17:51
lol if you get time this is one im trying, to do myself :)
i'll write this now if ur still around since off the top of my head i cant recall how i did it and if u query me i will hopefully have remembered, but the jist of it is putting text from a file into a variable so i could do the above and other stuff.

Report •
Related Solutions


Ask Question