search text files

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: search text files

  1. #1
    Join Date
    Aug 2006

    Lightbulb search text files

    how do you search text files for certain text and read that line only


  2. #2
    Join Date
    Nov 2003
    Portland, OR
    I don't know how you can search a text file without reading it. ;-) If the file is small, I would probably read the file into a string variable and use the Split function to turn it into a string array, then loop through the array looking for the line I want. If it's too large to load all at once, you can read the file one line at a time and stop when I find the text I'm looking for.
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2005
    UK, London
    Hi you can find a java implementation of what you want at the following link, the idea as phil has mentioned is to read each line one by one and compare the data with your search criterial.

    It should be easy to transfer the code to Well hopefully

Similar Threads

  1. text files
    By Spumbu1977 in forum VB Classic
    Replies: 3
    Last Post: 12-24-2005, 01:45 PM
  2. Replies: 0
    Last Post: 12-20-2005, 05:29 AM
  3. text search
    By geertvdijk in forum VB Classic
    Replies: 4
    Last Post: 03-16-2005, 12:39 PM
  4. Text files to Oracle
    By Ricardo in forum Database
    Replies: 1
    Last Post: 02-13-2002, 04:55 PM
  5. Text Files
    By James Abbott in forum Web
    Replies: 0
    Last Post: 10-23-2001, 06:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center