【问题标题】:Convert text to ascii code using DOS使用 DOS 将文本转换为 ascii 代码
【发布时间】:2016-02-21 05:56:44
【问题描述】:

我来这里是想走另一条路(与张贴在 echo -e equivalent in Windows?):

我有一个带有 ASCII 字符的文本文件,要转换为一个文本文件,其 ASCII 等效于文本文件中的字符。

例如。将包含“--”的文本文件更改为包含“4545”的文本文件。

谁有这方面的dos代码? 谢谢,

【问题讨论】:

  • 既然是windows机器,为什么不用vbscript呢?

标签: ascii dos


【解决方案1】:

对于微软 QBasic

dim character$(1):dim number%
open "inputfile" for Binary as 1
open "outputfile" for Binary as 2
while not eof(1)
get #1,,character$:put #2,,asc(character$)
'here one byte string is converted into character number
wend
close

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 2010-10-18
    • 1970-01-01
    • 2019-08-06
    • 1970-01-01
    相关资源
    最近更新 更多