![]() |
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-13 19:18 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » How to judge that a TXT document is an empty document |
| Printable Version 1,827 / 7 |
| Floor1 xztw | Posted 2006-08-19 22:41 |
| 初级用户 Posts 8 Credits 20 | |
|
How to judge that there is no content in a TXT document
|
|
| Floor2 paldos | Posted 2006-08-19 23:20 |
| 初级用户 Posts 27 Credits 62 | |
| Floor3 xztw | Posted 2006-08-20 00:46 |
| 初级用户 Posts 8 Credits 20 | |
| Floor4 namejm | Posted 2006-08-23 00:14 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
What kind of document is considered an empty document? If only a document with no content is considered empty, then the method of judging the file size doesn't work, because if you enter N spaces and then save it, the file size must not be 0. At this time, you can only use the form of findstr. test.txt to judge the presence of content to get the correct answer.
|
|
| Floor5 bagpipe | Posted 2006-08-23 09:43 |
| 银牌会员 Posts 425 Credits 1,144 From 北京 | |
|
The correct above
findstr . test.txt>nul&&echo No Empty||echo Empty |
|
| Floor6 IceCrack | Posted 2006-08-23 14:07 |
| 中级用户 Posts 168 Credits 332 From 天涯 | |
Originally posted by namejm at 2006-8-23 00:14: I actually think that judging the file size is also okay. One is that a file with N spaces has a size. So it is okay to use the size. Second, even if the file size of N spaces is 0 bytes. Then such a file is also meaningless. So it can also be ignored |
|
| Floor7 sword221 | Posted 2006-08-27 03:30 |
| 初级用户 Posts 17 Credits 30 | |
|
What you said is all correct. A document with a size of 0 is generally meaningless, so it can also be regarded as an empty document
|
|
| Floor8 namejm | Posted 2006-08-27 07:42 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
Originally posted by IceCrack at 2006-8-23 14:07: icracrack is wrong here. Now we are investigating the precise definition of an empty file, not the question of whether the file is meaningful or not—files with spaces but no other content are useful to some people, and at this time they are meaningful; but they are not useful to many people, and at this time they are not meaningful; whether they are meaningful or not is different for each person. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |