China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-02 04:33
中国DOS联盟论坛 » 论坛回收站 » Comprehensive Text Processing Issues View 2,303 Replies 5
Original Poster Posted 2009-10-08 10:57 ·  中国 福建 福州 电信
新手上路
Credits 10
Posts 4
Joined 2009-10-05 11:22
16-year member
UID 152631
Gender Male
Status Offline
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 ]
Floor 2 Posted 2009-10-08 14:27 ·  中国 福建 福州 电信
新手上路
Credits 10
Posts 4
Joined 2009-10-05 11:22
16-year member
UID 152631
Gender Male
Status Offline
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 ]
Floor 3 Posted 2009-10-08 16:25 ·  中国 上海 杨浦区 电信
管理员
★★
Credits 389
Posts 198
Joined 2008-09-23 12:00
17-year member
UID 126405
Gender Male
Status Offline
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
Floor 4 Posted 2009-10-08 20:24 ·  中国 福建 福州 电信
新手上路
Credits 10
Posts 4
Joined 2009-10-05 11:22
16-year member
UID 152631
Gender Male
Status Offline
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 ]
Floor 5 Posted 2009-10-08 20:30 ·  中国 上海 杨浦区 电信
管理员
★★
Credits 389
Posts 198
Joined 2008-09-23 12:00
17-year member
UID 126405
Gender Male
Status Offline
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
Floor 6 Posted 2009-10-08 20:37 ·  中国 福建 福州 电信
新手上路
Credits 10
Posts 4
Joined 2009-10-05 11:22
16-year member
UID 152631
Gender Male
Status Offline
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
Forum Jump: