Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie needs example of info extraction and insertion on text files

Status
Not open for further replies.

icantcodewell

Technical User
Apr 25, 2005
1
US
hi,

im just starting out and could use an example of a java program that searches one file (file_a.txt) for strings (string_x) and (string_y) then will write the strings (x, y) out to a new file (file_b.txt).

i figure that if i can see it done i will better be able to understand how it works. any help would be appriciated, thanks.
 
Have a look at these links :


You want a BufferedReader, then read each line into a String, use the String.indexOf() method, or a regex pattern matcher to check each line.

--------------------------------------------------
Free Database Connection Pooling Software
 
Oh, and normally core Java API questions should be post in forum269 .

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top