0000659688 20150112103831 6.62 6.62 0.00 0.00 6.62
将上面数值用VB如何写入到文本文件中?
以“字符串”的格式输出,就可以了啊。 Open "123.txt" For Output As #1 ' print 语句后面加上逗号, ' 输出后不换行、输出项目后面自动加空格补齐到“制表定位”处 Print #1, "0000659688", Print #1, "20150112103831", Print #1, "6.62", Print #1, "6.62", Print #1, "0.00", Print #1, "0.00", Print #1, "6.62", Close
如果你要每项之间都是用“10个空格”来分隔,就象这样写: Const SEPARATION As String = " " Open "123.txt" For Output As #1 Print #1, "0000659688" & SEPARATION; Print #1, "20150112103831" & SEPARATION; Print #1, "6.62" & SEPARATION; Print #1, "6.62" & SEPARATION; Print #1, "0.00" & SEPARATION; Print #1, "0.00" & SEPARATION; Print #1, "6.62" Close
注意区别:先前句尾用的是逗号,现在是分号。
|