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-08-01 14:44
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Two more difficult batch file problems (Solved) View 1,511 Replies 6
Original Poster Posted 2005-11-21 20:37 ·  中国 广东 茂名 高州市 电信
初级用户
Credits 38
Posts 11
Joined 2005-11-19 01:46
20-year member
UID 45520
Status Offline
1. Modify the string content in a specified column of a text file
Example: in the text file a.ini, the content in column 9 is: aaa bbb 123456
It needs to be changed to: aaa bbb 88888
What program should be used to do this?

2. Use the content of an existing text file to replace the string content in a specified column of another text file.
Example: contents of a.ini:
aaa bbb ccc
aaa bbb ccc =123456789

Need to use the contents inside another b.ini to replace the 123456789 content in a.ini.
How should this be done?

Please help solve this!

[ Last edited by jojo2008 on 2005-11-27 at 16:36 ]
Floor 2 Posted 2005-11-21 21:42 ·  中国 广东 茂名 高州市 电信
初级用户
Credits 38
Posts 11
Joined 2005-11-19 01:46
20-year member
UID 45520
Status Offline
Also, can the tool INIFile 1.0 be used in the above batch file processing?
Floor 3 Posted 2005-11-21 21:49 ·  中国 广东 茂名 高州市 电信
初级用户
Credits 38
Posts 11
Joined 2005-11-19 01:46
20-year member
UID 45520
Status Offline
Looking for a change file tool!

[ Last edited by jojo2008 on 2005-11-21 at 21:53 ]
Floor 4 Posted 2005-11-21 23:51 ·  中国 辽宁 锦州 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
21-year member
UID 40733
Gender Male
Status Offline
The OP should explain the required working environment, and the examples you gave are not clear enough. It would be best to post the complete ones.
Under NT, using for to parse text can achieve the replacement, but it's very cumbersome.
Try sed. There are versions for various systems, and it's very convenient for handling text.
Floor 5 Posted 2005-11-22 17:01 ·  中国 广东 茂名 高州市 电信
初级用户
Credits 38
Posts 11
Joined 2005-11-19 01:46
20-year member
UID 45520
Status Offline
WINDOWS real mode
Floor 6 Posted 2005-11-22 19:20 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
Originally posted by jojo2008 at 2005-11-21 21:49:
Looking for a change file tool!

For the CHANGE download and usage instructions, please see this thread:
http://www.cn-dos.net/forum/viewthread.php?tid=17669
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 7 Posted 2005-11-27 16:35 ·  中国 广东 茂名 高州市 电信
初级用户
Credits 38
Posts 11
Joined 2005-11-19 01:46
20-year member
UID 45520
Status Offline
I've already written a piece of software myself to do it! Many thanks! This thread is locked!
Forum Jump: