中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-13 23:08
47,812 topics / 349,916 posts / today 0 new / 48,268 members
论坛回收站 » Comprehensive Text Processing Issues
Printable Version  2,545 / 5
Floor1 hackf Posted 2009-10-08 10:57
新手上路 Posts 4 Credits 10
The problem is
The content of a.txt is:
dfasf
fadsfasfs
dfasfas
fdasfas
dfasfa
asdfas
sadfas
dsaf
..........
The content of b.txt is:
1

2
3 (Replace the content of a.txt line by line with the character "3", and save each time with the save count as the name).txt, until the last line of a.txt is completed, and stop.
4
5

6
After running, the content of the first saved 1.txt is
1

2
dfasf
4
5

6

[ Last edited by hackf on 2009-10-8 at 20:28 ]
Floor2 hackf Posted 2009-10-08 14:27
新手上路 Posts 4 Credits 10
The problem is solved. Compared with Batch Processing Home, the forum management of DOS Union is much worse. I'm telling the truth. The administrators please don't mind.

[ Last edited by hackf on 2009-10-8 at 14:28 ]
Floor3 DOSroot Posted 2009-10-08 16:25
管理员 Posts 198 Credits 389
If you have solved the problem by yourself, please share the solution with everyone, otherwise such a post without an end is meaningless.

http://www.cn-dos.net/forum/viewthread.php?tid=46048#pid323252
Floor4 hackf Posted 2009-10-08 20:24
新手上路 Posts 4 Credits 10
A master helped me solve it, and the method is like this
@echo off & setlocal enabledelayedexpansion
set m=1
for /f "delims=" %%i in (a.txt) do (
for /f "delims=" %%a in (b.txt) do (
set "foo=%%a"
set foo=!foo:3=%%i!
echo/!foo!
)>>!m!.txt
set /a m+=1
)
exit

[ Last edited by hackf on 2009-10-8 at 20:34 ]
Floor5 DOSroot Posted 2009-10-08 20:30
管理员 Posts 198 Credits 389
If you are asking about Windows-related issues but posting in the DOS section, it will be deleted.

Please take a look at the sticky post:

http://www.cn-dos.net/forum/viewthread.php?tid=46409
Floor6 hackf Posted 2009-10-08 20:37
新手上路 Posts 4 Credits 10
Originally posted by DOSroot at 2009-10-8 20:30:
If you are asking about a Windows-related issue but posting it in the DOS section, it will be deleted.
Please take a look at the sticky post:

http://www.cn-dos.net/forum/viewthread.php?tid=46409


Then it has to be deleted
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023