|
sexgirl
新手上路

积分 6
发帖 4
注册 2005-8-3
状态 离线
|
『楼 主』:
请教大侠,dos命令有几种方式生成文本文件(*.txt)
使用 LLM 解释/回答一下
请教大侠,dos命令有几种方式生成文本文件(*.txt)
Ask the great experts, how many ways are there to generate text files (*.txt) using DOS commands?
|
|
2005-8-3 22:00 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
Re sexgirl:
请告诉我们你需要这项知识的初衷或者目标是什么,有什么样的限制条件,以及其他你觉得应该声明的背景信息。否则你很难得到你想要的答案。
Re sexgirl:
Please tell us the original intention or goal for which you need this knowledge, what the restrictions are, and other background information you think should be stated. Otherwise, it will be difficult for you to get the answer you want.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-3 22:11 |
|
|
sexgirl
新手上路

积分 6
发帖 4
注册 2005-8-3
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
职称计算机考试试题中有一题“在windows98的MS-DOS方式下,由键盘生成一个文件,文件的内容是I`m a teacher,文件名是LX.TXT,保存到A盘”

In the computer professional title examination questions, there is a question: "In the MS-DOS mode of Windows 98, generate a file from the keyboard. The content of the file is 'I`m a teacher', the file name is LX.TXT, and save it to drive A."

|
|
2005-8-3 22:32 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
Re sexgirl:
那么可以使用这样的句式(使用了echo命令与重定向输出符号">"):
echo I'm a teacher>A:\LX.TXT
或者使用这个句式(使用copy命令和控制台设备con):
copy con A:\LX.txt
I'm a teacher(在此按Ctrl+Z,不包含括号)
Re sexgirl:
Then you can use the following sentence pattern (using the echo command and the redirection output symbol ">"):
echo I'm a teacher>A:\LX.TXT
Or use this sentence pattern (using the copy command and the console device con):
copy con A:\LX.txt
I'm a teacher(Press Ctrl+Z here, excluding the parentheses)
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-3 22:39 |
|
|
sexgirl
新手上路

积分 6
发帖 4
注册 2005-8-3
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
感激不尽,第二种方法是正确答案,我还想弄清Ctrl+Z的代表的具体含义
Grate不尽, the second method is the correct answer, I also want to figure out the specific meaning represented by Ctrl+Z
|
|
2005-8-3 22:53 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Ctrl +Z表示文件结束。按f6也可以。用16进制编辑器查看一下。
Ctrl +Z indicates the end of the file. Pressing F6 can also do it. Check it with a hex editor.
|

简单就是美 |
|
2005-8-3 22:58 |
|
|
sexgirl
新手上路

积分 6
发帖 4
注册 2005-8-3
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
非常感谢,今天才知道DOS如此高深,再一次对大侠表示敬意!
Thank you very much. I just learned today that DOS is so profound. Once again, I show my respect to the expert!
|
|
2005-8-3 23:03 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
我清楚地记得这个问题在去年讨论过,而且那条计算机考试题目一模一样。
I clearly remember that this question was discussed last year, and that computer exam question was exactly the same.
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2005-8-3 23:35 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Re sexgirl:
对于你的题目来说,我实在想不通,为什么echo+重定向不是正确答案?除非它要求文件中不含回车换行,但是它并没有如此限制。
对于这个题目来说,其实还有更多的方法,比如:
type con > a:\lx.txt
I'm a teacher(在此按Ctrl+Z,不包含括号)
或者:
debug a:\lx.txt
e 100 "I'm a teacher"
r cx
d
w
q
还有edlin的方案,而且它没有限定不使用第三方工具,那可选的答案更是举不胜举。事实上,自从我对DOS略有了解后,就发现很多计算机DOS试题中所谓的“标准答案”的历史局限性和应用局限性。
Re sexgirl:
For your question, I really can't figure out why echo + redirection is not the correct answer? Unless it requires that there are no carriage returns and line feeds in the file, but it doesn't have such a restriction.
For this question, in fact, there are more methods, such as:
type con > a:\lx.txt
I'm a teacher (press Ctrl+Z here, excluding the parentheses)
Or:
debug a:\lx.txt
e 100 "I'm a teacher"
r cx
d
w
q
There is also the edlin solution, and it doesn't limit the use of third-party tools, so there are countless optional answers. In fact, since I have a little understanding of DOS, I have found that the so-called "standard answers" in many computer DOS test questions have historical limitations and application limitations.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-6 20:42 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Re willsort:
呵呵,所谓的“正确答案”其实是那本计算机教材的参考答案而已,大可不必钻牛角尖。现在很多计算机考级的教材(一级或二级)里,那些有关DOS的题目都比较简单,所以答案也不会太高深,用copy con的方法是很常见的做法,计算机初学者容易接受。我倒觉得用echo重定向的方法属于批处理编程领域,计算机一、二级等考试通常不会涉及批处理的应用,而用debug来做的方法即使是高手也甚少用的上。
Last edited by JonePeng on 2005-8-6 at 22:00 ]
Re: re-sort:
Hehe, the so-called "correct answer" is actually just the reference answer from that computer textbook. There's no need to get overly nitpicky. Nowadays, many computer certification exam textbooks (level one or two) have relatively simple questions related to DOS, so the answers aren't too profound. The method of using copy con is a very common practice, which is easy for computer beginners to accept. I actually think the method of using echo redirection belongs to the field of batch processing programming. Computer level one, two, etc. exams usually don't involve the application of batch processing, and the method of using debug is rarely used even by experts.
Last edited by JonePeng on 2005-8-6 at 22:00 ]
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2005-8-6 21:59 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Re JonePeng:
我的意思是,我们可以跳出考题的拘囿,运用发散性思维,让楼主的 “dos命令有几种方式生成文本文件” 主题更加名符其实。
关于 copy con ,未必会比 type con > 常见,至于是否容易接受,那也要看接受的程度,有多少人能知其然又知其所以然,比如 con 是什么意思?它代表什么?为什么它不是一个文件,却能够拷贝?为什么 Ctrl+Z 代表文件结束?
关于 echo ,事实上我在命令行的使用它的频率远高于 copy con ,因为它的输入量更小一些。而 debug 在某些领域,也是经常用到的。因为他们都各有优缺点,更好的研究它们,可以让我们在需要它的时候,不至于束手无策。
实际上,生成文本文件的方法相当多,我再给出管道命令的方案吧:
find "" /v < con > filename
text
(^Z)
more < con > filename
text
(^Z)
sort < con > filename
text
(^Z)
echo text|find "" /v > filename
echo text|more > filename
echo text|sort > filename
echo text|sort|find "" /v > filename
echo text|find "" /v|sort > filename
echo text|sort|more|find "" /v > filename
.....
Re JonePeng:
What I mean is that we can break out of the constraints of exam questions, use divergent thinking, and make the topic "How many ways are there to generate text files with DOS commands" by the original poster more worthy of its name.
Regarding copy con, it may not be more common than type con >. As for whether it is easy to accept, it also depends on the degree of acceptance and how many people can know both the reason and the result. For example, what does con mean? What does it represent? Why is it not a file but can be copied? Why does Ctrl+Z represent the end of a file?
Regarding echo, in fact, I use it in the command line much more frequently than copy con, because its input volume is smaller. And debug is also often used in some fields. Because they each have their own advantages and disadvantages, studying them better can prevent us from being at a loss when we need them.
In fact, there are quite a lot of methods to generate text files. I will give the scheme of pipeline commands again:
find "" /v < con > filename
text
(^Z)
more < con > filename
text
(^Z)
sort < con > filename
text
(^Z)
echo text|find "" /v > filename
echo text|more > filename
echo text|sort > filename
echo text|sort|find "" /v > filename
echo text|find "" /v|sort > filename
echo text|sort|more|find "" /v > filename
.....
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-8 11:52 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
真想不到还有这么多途径!厉害!!!
Really didn't expect there are so many ways! Great!!!
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2005-8-8 14:35 |
|
|
hbhhwy
新手上路

积分 8
发帖 6
注册 2009-6-8 来自 深圳市
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
高手学习中,我什么时候达到你们的水平
Learning hard! When will I reach your level?
|
|
2009-6-21 03:27 |
|
|
crocodile
初级用户
 
积分 25
发帖 12
注册 2007-8-30
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
说实话我用 “>” 多过任何其他
echo 确实是非常常用的, 倒是 copy con ... 在部分编程的时候才用, 频率远没有 echo & > 来得高
这些劳什子的计算机考试出题出题也要准确些嘛,别对的错的都不明白,只用单一答案评定
To be honest, I use ">" more than anything else. echo is indeed very commonly used. However, copy con... is only used in some programming, and the frequency is far lower than that of echo & >. These damn computer exam questions should be more accurate. Don't not understand whether it's right or wrong, and just use a single answer to evaluate.
|
|
2009-6-21 07:08 |
|
|
pjdjq002
新手上路

积分 10
发帖 6
注册 2009-6-20
状态 离线
|
|
2009-6-21 08:24 |
|