I now only know there is a findstr command, which can only be used to find the characters to be modified, but I don't know what command to use to process after finding. I want to ask all the experts.
For example. In the DOS 7.1 English environment, to edit a.txt
Now I want to create a batch file, whose function is:
If there is a line "a=10" in the a.txt file, change 10 to 0. If there is originally "a=0", then continue with the following batch processing.
If there is a line of text "b=我", delete this line of text (this line of text is not necessarily at the end of the text, may be in the middle, but definitely occupies a single line). If there is no "b=我", then add "b=你" to a.txt (I know the append command ">>", just want to know whether it can be inserted to a specific position, such as the Nth line)
Thank you all for your efforts.
If there is no solution under pure DOS, as long as there is a solution that can have the same effect under XP SP2 or 98, it is also okay. Thanks
P.S. I am a programming novice, and I have only made small things like boot disks with batch processing myself.
[ Last edited by rx79 on 2006-5-10 at 21:13 ]
For example. In the DOS 7.1 English environment, to edit a.txt
Now I want to create a batch file, whose function is:
If there is a line "a=10" in the a.txt file, change 10 to 0. If there is originally "a=0", then continue with the following batch processing.
If there is a line of text "b=我", delete this line of text (this line of text is not necessarily at the end of the text, may be in the middle, but definitely occupies a single line). If there is no "b=我", then add "b=你" to a.txt (I know the append command ">>", just want to know whether it can be inserted to a specific position, such as the Nth line)
Thank you all for your efforts.
If there is no solution under pure DOS, as long as there is a solution that can have the same effect under XP SP2 or 98, it is also okay. Thanks
P.S. I am a programming novice, and I have only made small things like boot disks with batch processing myself.
[ Last edited by rx79 on 2006-5-10 at 21:13 ]


