![]() |
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-06 23:55 |
48,040 topics / 350,125 posts / today 1 new / 48,252 members |
| DOS疑难解答 & 问题讨论 (解答室) » [Help] Read content into another text file |
| Printable Version 2,175 / 6 |
| Floor1 mlroger | Posted 2010-05-19 14:05 |
| 新手上路 Posts 4 Credits 4 | |
|
"
PK_tag_BATCH.pck PK_ORPHAN_BATCH.pck " Everyone, this is the content of a text file. How do I read out the content between and , and then store it in another text file? Use FOR and IF in DOS to read out the content between each heading. [ Last edited by mlroger on 2010-5-20 at 16:18 ] |
|
| Floor2 HAT | Posted 2010-05-20 00:09 |
| 版主 Posts 5,017 Credits 9,023 | |
| Floor3 mlroger | Posted 2010-05-20 16:09 |
| 新手上路 Posts 4 Credits 4 | |
|
I still don't understand.
|
|
| Floor4 HAT | Posted 2010-05-21 14:38 |
| 版主 Posts 5,017 Credits 9,023 | |
|
What part don't you understand?
|
|
| Floor5 mlroger | Posted 2010-05-21 16:42 |
| 新手上路 Posts 4 Credits 4 | |
|
Is SED a DOS command? I want to use DOS for to read the contents of *.TXT, then use IF to check the content in between and display it. Combine FOR and IF, checking them one by one.
|
|
| Floor6 7testing | Posted 2010-06-03 13:59 |
| 新手上路 Posts 17 Credits 16 | |
|
type *.txt | tee test.txt
*.txt is the original file test.txt is the newly generated file, and its content is the same as *.txt. |
|
| Floor7 zhoupeng243 | Posted 2010-09-24 13:12 |
| 新手上路 Posts 15 Credits 13 | |
|
It's best to make a batch file compfile.bat;
the parameters %1, %2, %3, %4 in it are finename.txt, new.txt, startstring, endstring For any similar operation, just call compfile "finename.txt" "new.txt" "startstring" "endstring" Then the OP can use call compfile temp.txt tempnew.txt "[CTRL]" "[VIEW]" Which expert can improve compfile.bat? I need it urgently too! Of course I haven't considered special characters in the call parameters such as []%& |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |