pro_vb thread: File handling in VB..
The real problem with the original request is the length of text that
constitutes the logical break Linda is looking for. If it were me, I'd look
for "C: The gathering", which would eliminate the possibility of the text
being spread across two lines.
Pete
-----Original Message-----
From: Williams, Sean [mailto:swilliams@g...]
Sent: Wednesday, December 11, 2002 8:03 AM
To: professional vb
Subject: [pro_vb] Re: File handling in VB..
Almost makes you wonder if it's worth while opening in something like excel
and then doing a .find across the cells....
Depends on the size of the file I guess...
- Sean
-----Original Message-----
From: Keith Bamberger [mailto:keith@p...]
Sent: Wednesday 11 December 2002 13:44
To: professional vb
Subject: [pro_vb] Re: File handling in VB..
Perhaps Sean, but then you never know do you ;) I guess its best to be able
to respond to all eventualities :) and by concatinating it will work, but I
think its a better solution to only loop until necessary and not the whole
file (Which I guess you could still do and only concatinate until you have
found what youre looking for). There are a few ways to solve this problem of
course, and because this doesnt look like it matters on the speed I think
not referencing the FSO would be nice but I dont really know the correct
choice (If there really is any) apart from the fact that the FSO as stated
gives you more to play with :)
----- Original Message -----
From: "Williams, Sean" <swilliams@g...>
To: "professional vb" <pro_vb@p...>
Sent: Wednesday, December 11, 2002 12:24 PM
Subject: [pro_vb] Re: File handling in VB..
> Actually Keith, I think it's one line, just the word wrap has taken it
to
> two :)
>
>
> Sean
>
> -----Original Message-----
> From: Keith Bamberger [mailto:keith@p...]
> Sent: Wednesday 11 December 2002 09:01
> To: professional vb
> Subject: [pro_vb] Re: File handling in VB..
>
> Sure youre right but I thought that she had lined code? Didnt she give an
> example of the textfile? If so did I read it incorrectly :)
> ----- Original Message -----
> From: "Peter N. Kipe" <pkipe@c...>
> To: "professional vb" <pro_vb@p...>
> Sent: Tuesday, December 10, 2002 5:18 PM
> Subject: [pro_vb] Re: File handling in VB..
>
>
> > Keith,
> >
> > This code assumes that the entire text will be on the same line -- if
not,
> > it won't work. A solution to that problem would be to concatenate all
> lines
> > together into a buffer with crlfs removed and spaces inserted, then do
the
> > InStr.
> >
> > Pete
> >
> > -----Original Message-----
> > From: Keith Bamberger [mailto:keith@p...]
> > Sent: Tuesday, December 10, 2002 4:44 AM
> > To: professional vb
> > Subject: [pro_vb] Re: File handling in VB..
> >
> >
> > Hi Linda heres a small peice of code which will do what you want,
> >
> > Dim Contains As Boolean
> > Contains = False
> >
> > Open "c:\test.txt" For Input As #1
> >
> > Do While Not EOF(1) Or Contains
> >
> > Line Input #1, linevar
> >
> > If (InStr(1, linevar, "The gathering of information has been cancelled
as
> > requested. Good bye")) Then
> > MsgBox "Conatins The gathering of information has been cancelled as
> > requested. Good bye"
> > Contains = True
> > End If
> >
> > Loop
> >
> > Close #1
> >
> >
> > open a new VB project and test it out.
> >
> >
> >
> >
> >
> >
> > On 12/10/2002 5:45 AM, Linda Hay <linda_hay2002@y...> wrote:
> > >Hello People.
> > >
> > >This is Linda.
> > >
> > >I'm doing some development in VB at present & got stuck in the most
> > >weird
> > >situation that I never came across earlier. It will realy be nice
> > >if
> > >someone out there could help me out on this one.
> > >
> > >All I have to do is to read the following file (named "vxml.txt"
> > >& stored
> > >in "C:" drive) & to check for the occurrence of the string "The
gathering
> > >
> > >of information has been cancelled as requested. Good bye".
> > >
> > >The text file is defined below.
> > >
> > >Please help me.
> > >
> > >Cheers.
> > >
> > >Linda.
> > >
> > >23:16:38.474 S: Starting V011129 at Mon Dec 09 23:16:38 LKT 2002
> > >23:16:38.474 X: Java: Sun Microsystems Inc. 1.3.1
> > >23:16:38.474 X: requested locale: en_US
> > >23:16:44.403 V: file:C://MainMenuSite.vxml (fetch get)
> > >23:16:44.453 F: file:C://MainMenuExit.es (prefetch get)
> > >23:16:44.493 F: file:C://MainMenuExit.jsgf (re-fetch get)
> > >23:16:44.503 K: file not modified
> > >23:16:44.543 S: initializing application
> > >23:16:44.563 V: file:C://MainMenu.vxml (fetch get)
> > >23:16:44.583 F: file:C://EmailClient.au (prefetch get)
> > >23:16:44.783 S: running
> > >23:16:44.793 C: (audio clip)
> > >23:16:44.823 C: Welcome to the voice enabled email client, via voice
> > >
> > > synthesis and recognition. Please make your choice
> > >by
> > > selecting the appropriate menu option.
> > >23:16:44.913 C: Please select one option from: Fetch Email. Create
> > >Email.
> > > Send SMS. Hangup.
> > >23:16:44.933 A: not listening
> > >23:16:44.943 A: listening
> > >23:17:06.895 A: Too quiet (0.1)
> > >23:17:07.125 A: Too quiet (0.1)
> > >23:17:08.968 H: help
> > >23:17:08.978 C: Please select a menu option.
> > >23:17:10.580 A: Audio level (0.3)
> > >23:17:10.810 A: Audio level (0.3)
> > >23:17:12.533 H: Hang up
> > >23:17:12.533 V: file:C://MainMenuSite.vxml (cache)
> > >23:17:12.543 C: The gathering of information has been cancelled as
> > >
> > > requested. Good bye
> > >23:17:19.233 W: 1 problem word follows
> > >23:17:19.233 W: SMS
> > >23:17:19.273 K: clean cache 1
> > >23:17:19.273 K: clean cache 2
> > >23:17:19.343 K: clean cache 3
> > >23:17:19.343 K: lock retries 0
> > >23:17:19.343 S: exit (0)
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>
>