|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File pointer to be positioned at the last occurance of a keywordHi All,
I have a .txt file, in which I have to look for the last occurance of a keyword, and process contents of the file from that point onwards. How can this be achieved? Can anybody guide me? Thanks, kd Is there a specific keyword or can it be any?
If one, its easy & if more then create a regex to handle it. Crouchie1998 BA (HONS) MCP MCSE Hi Crouchie,
It is a specific word that I am looking for. It would be great if you could post a sample code here. Thanks, kd Show quoteHide quote "Crouchie1998" wrote: > Is there a specific keyword or can it be any? > > If one, its easy & if more then create a regex to handle it. > > Crouchie1998 > BA (HONS) MCP MCSE > > > "kd" <k*@discussions.microsoft.com> schrieb: Reading a text file line-by-line or blockwise with a progress indicator> I have a .txt file, in which I have to look for the last occurance of a > keyword, and process contents of the file from that point onwards. <URL:http://dotnet.mvps.org/dotnet/faqs/?id=readfile&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hi,
I don't think that, reading the text file, line by line and checking for the keyword is a good idea, because, the file is large and the keyword occurs several times in the file. I need to only process the data that occurs after the last occurance of the keyword in the file. Regards, kd Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "kd" <k*@discussions.microsoft.com> schrieb: > > I have a .txt file, in which I have to look for the last occurance of a > > keyword, and process contents of the file from that point onwards. > > Reading a text file line-by-line or blockwise with a progress indicator > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=readfile&lang=en> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > Hi Herfried,
Thanks for your reply. Is there a work-around for this situation without having to read line-by-line? Regards, kd. Show quoteHide quote "kd" wrote: > Hi, > > I don't think that, reading the text file, line by line and checking for the > keyword is a good idea, because, the file is large and the keyword occurs > several times in the file. I need to only process the data that occurs after > the last occurance of the keyword in the file. > > Regards, > kd > > "Herfried K. Wagner [MVP]" wrote: > > > "kd" <k*@discussions.microsoft.com> schrieb: > > > I have a .txt file, in which I have to look for the last occurance of a > > > keyword, and process contents of the file from that point onwards. > > > > Reading a text file line-by-line or blockwise with a progress indicator > > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=readfile&lang=en> > > > > -- > > M S Herfried K. Wagner > > M V P <URL:http://dotnet.mvps.org/> > > V B <URL:http://classicvb.org/petition/> > > Hi Herfried,
The only way to go about this, is to read the file line by line and to the processing? Please reply. Thanks, kd Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "kd" <k*@discussions.microsoft.com> schrieb: > > I have a .txt file, in which I have to look for the last occurance of a > > keyword, and process contents of the file from that point onwards. > > Reading a text file line-by-line or blockwise with a progress indicator > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=readfile&lang=en> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > kd,
Read the rows in using the readline and set the lines in an arraylist Process that arraylist backwards using the \\\ For i as integer = arraylist.length - 1 step -1 see if it exist in the lines using the indexof or the instr Next /// I hope this helps, Cor Hi Cor,
Thanks for the reply. I do however have a question. Would Arraylist be able to store a huge file? What is maximum capacity of Arraylist? Regards, kd. Show quoteHide quote "Cor Ligthert" wrote: > kd, > > Read the rows in using the readline and set the lines in an arraylist > > Process that arraylist backwards using the > \\\ > For i as integer = arraylist.length - 1 step -1 > see if it exist in the lines using the indexof or the instr > Next > /// > I hope this helps, > > Cor > > > KD,
I think that you should try it, however it is of course dependable from the memory that is available Cor
Dragging a mail from Outlook/Outlook Express in to a .NET VB app
DataGrid Bind to DataSet, then Bind to DaTaview, GOT ERROR...PLS HELP Connection pool problems Lines and Boxes in VB.Net Public Variables in Module1 Bound combo box problem Newbie VB Question Connectionstring Deserialization version mismatch Copy Directry including across the Volumes. |
|||||||||||||||||||||||