How to read file from specific word in php?

How to read a specific word from a line in a text file vb express 2010?

  • Im trying to create a program that will read a simple txt file and locate a specific word. If that word exists I want it to print the whole line of txt to a textbox. I already know and understand how to read a file line by line, but because my files are printed differently depending on what im doing, reading line by line is not helping at all. So basically, I want to find a line of text starting with a word lets call it "Data" and print that whole line of text to a text box. I have googled and read forums for days with no avail. Any help would be appreciated, thanks.

  • Answer:

    Please post a small amount of sample rows and include the row that you want to be found. Personally, for this task, I would use regular expressions. Regular expressions make short work of parsing and getting the rows you want from a text file. A free dot net expression tool can be found here: http://regexhero.net/ http://www.4guysfromrolla.com/articles/022603-1.aspx You can change szExpression in the links below search for any of the text you want to search like for Bit rate.

Rusty Shackleford at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.