本文介绍了是否有类似于C的sscanf的VB6函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试读取由以下几种形式的文本行组成的文件...

I'm trying to read in a file consisting of lines of text of the following sort of form...

first value 1352.2      second value     12      third value    32323
first value 1233.2      second value     22      third value    23333
first value 1233.1      second value     21      third value    64344

因此,我正在寻找一种类似于fscanf或sscanf的函数,以一次性查找每一行.有这样的功能吗?或者我必须手动将每一行分开(有几种不同的行).

so I'm looking for a function analagous to fscanf or sscanf to munch each line up in one go. Is there such a function or must I pick apart each line by hand (there are several different kinds of lines).

推荐答案

虽然MarkJ为您提供了VB6的做事方式,但您可能需要查看FWIW:

While MarkJ has given you the VB6 way of doing things, you may want to check out FWIW:

http://www.freevbcode.com/ShowCode.asp?ID=3806

在VB中实现C字符串函数SScanf和StrTok"

"C String Functions SScanf and StrTok Implemented in VB"

它实现了一个ScanString()函数,该函数应该是sscanf()的仿真.

It implements a function ScanString() that's supposed to be an emulation of sscanf().

这篇关于是否有类似于C的sscanf的VB6函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 22:44