批处理怎么将一串数字按6位数一行分开排列?例如11111111111111111处理后:111111 111111 11

批处理怎么将一串数字按6位数一行分开排列?例如11111111111111111处理后:111111 111111 111111
批处理怎么将一串数字按6位数一行分开排列?
例如11111111111111111处理后:
111111
111111
111111
@echo off
set /p str=> 1.txt
if not "%str:6%"=="" (set str=%str:8%&goto fh)
pause
这个是我查资料和帖子摸索出来的。解决set /p和变量有存储限制问题
awalkingbird 1年前 已收到2个回答 举报

葵樱_qq 幼苗

共回答了14个问题采纳率:85.7% 举报

@echo off
set a=111111111111111111111111111111111
:begin
echo %a:,6%>>1.txt
set a=%a:6%
if not "%a%"=="" goto begin
notepad 1.txt

1年前 追问

6

awalkingbird 举报

你好,请问能不能把set a=1111111111111111111111改为读取test.txt文本的格式? 我改成set /p a=.txt 但是set /p和变量有存储限制,我的test.txt文本里超过了1024字节。set /p只能存储1024字节,剩下的就无法保存出来。

举报 葵樱_qq

加我百度hi交流下

半熟 幼苗

共回答了2个问题 举报

@echo off
for /f "delims=" %%i in (test.txt) set str=%%i &&goto :fh
:fh
echo %str:~,6%>> 1.txt
if not "%str:~6%"=="" (set str=%str:~8%&goto fh)
pause

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 19 q. 0.078 s. - webmaster@yulucn.com