English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

so here's the problem...
I need to search a fairly large txt file in visual basic for a stream. and then, once i have found that stream, i need to grab the next 20 characters and put it in a variable, how can i do this? I'm new to the whole programing thing, so, it will help if you can reply with a simple answer, thanks.

2007-02-13 09:21:33 · 5 answers · asked by nick m 1 in Computers & Internet Programming & Design

5 answers

technically, the answer is not that simple....


visit http://www.msdn.com/ and there are some good tutorials on it there!

2007-02-13 09:28:18 · answer #1 · answered by stultz_is 2 · 0 0

I'm pretty new to this stuff too, but off the top of my head, I'd probably read the contents of the text file into arrayed variables, then code an "OnChange" event for the text box to check for the search string in the appropriate arrayed variable. Actually.. if it were me.. I'd set up a small db, then use a data control to access the data - very little coding required! Sure there are some guru's out there who will tell you all this is crap - and give you an easier and more detailed solution!

2016-05-24 06:40:08 · answer #2 · answered by Anonymous · 0 0

.. I did this with an old version of Access once, by making a low level External System call to grab the contents of the file. That
was back in the mists of time now ... so, long forgotten.

While I don't have the direct answer, I can tell you that doing this
kind of thing with Perl ( or if you must C ) is so, so, so easy!

IMHO using VB for some things, is more like a using a very
heavy sledgehammer in order to crack a tiny seed. .. :o)

2007-02-13 10:10:59 · answer #3 · answered by Anonymous · 0 0

Do you have any code down yet ?
If you haven't got anything then I suggest reading the link provide in the earlier post.
If you have got something down then try posting on here so we can see what you have and assist you with it so that you can learn from it.

2007-02-13 09:45:38 · answer #4 · answered by EddieS 2 · 0 0

something like...

dim fso as scripting.filesystemobject, tso as scripting.textstream
dim strText as string, intPos as integer, strSub as string
set fso=new scripting.filesystemobject
set tso=fso.opentextfile(filename)
strtext=tso.read
intpos=instr(1,strtext,stream)
if intpos<>0 then strsub=mid(strtext,intpos+1,20)

2007-02-13 12:23:36 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers