![]() |
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-08-12 07:06 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] Change the first two characters on the first line of a text file from ID to id |
| Printable Version 835 / 6 |
| Floor1 rockyuan | Posted 2010-06-20 15:40 |
| 初级用户 Posts 21 Credits 21 | |
|
There are many text files. If the first line is ID, it needs to be changed to id, but there are a lot of files.
So I'd like to ask everyone to help think of a solution. |
|
| Floor2 HAT | Posted 2010-06-20 15:51 |
| 版主 Posts 5,017 Credits 9,023 | |
|
About how many files are there?
|
|
| Floor3 rockyuan | Posted 2010-06-20 15:52 |
| 初级用户 Posts 21 Credits 21 | |
|
At present I know there are 56 such files, and I know the filenames, but there may be new ones added in the future.
The total number of files is 1000+ It's a set of configuration files sent over by the developers, and every new file that comes in is like this. So I have to change them manually every time, which is very troublesome. [ Last edited by rockyuan on 2010-6-20 at 15:58 ] |
|
| Floor4 HAT | Posted 2010-06-20 18:38 |
| 版主 Posts 5,017 Credits 9,023 | |
| Floor5 rockyuan | Posted 2010-06-20 18:49 |
| 初级用户 Posts 21 Credits 21 | |
|
What if they are in different subdirectories?
|
|
| Floor6 HAT | Posted 2010-06-20 19:26 |
| 版主 Posts 5,017 Credits 9,023 | |
|
Use for /r to traverse them
|
|
| Floor7 rockyuan | Posted 2010-06-20 20:10 |
| 初级用户 Posts 21 Credits 21 | |
|
I'm just starting to learn, so I hope someone can give a specific example.
Also, I have two similar operations to ask about: 1, move the original first line of the file to the second line. Write 123 as the content of the first line 2, if the original first line of the file is blank (there is only a newline character, with no characters at all, including spaces), write 123 on this line |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |