Hi guys
You can take help from javadoc.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
use indexOf methos to find whether a perticular string exists in another
string or not.
FileReader fw=new Filereader("Main String.txt");
BufferedReader bw=new BufferedReader(fw);

String s=bw.readline();

here 's' is the first line of the text file.
to read next line use same command, thus it reads lines line by line. nd the
line'll be return as a string.

http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedReader.html

here u can read more abt readline method.

thus u can read the file line by line nd simultaniuosly chk whether a
perticular string is der in tat line or nt using index of method.

Hope this'll help u. :)



On Tue, Nov 17, 2009 at 9:37 AM, Siddhartha Ghosh <[email protected]>wrote:

> Hi Mr. Vishal,
> I will try to do the same.  Thanks.
> Can u plz.  suggest me some site which discusses such issues?
> Regards -
>
> *Siddhartha Ghosh, *
> Associate Professor , Dept. of Computer Science & Engillneering,
> G.Narayanamma Institute of Technology & Science,
> An ISO 9001 : 2000 Certified Institute, Shaikpet, Hyderabad - 500008,
> Andhra Pradesh, India.
> *Mobile:+91-9959613556*
> College  : 040-23565648 (exn.313)
> *"Success stories don't just happen they are made".*
>
>
> --- On *Mon, 16/11/09, vishal bhalabar <[email protected]>* wrote:
>
>
> From: vishal bhalabar <[email protected]>
> Subject: Re: [twincling] Urgent Need of some Java code
> To: [email protected]
> Date: Monday, 16 November, 2009, 5:40 PM
>
>
>  Hi this is Mr. VIshal Bhalabar.
>
> To find one word, take that word in one string.
> And open the file which is to be searched in read mode.
> Use the function of "substring" for every line of a file.
> You will find out that word in file.
>
> e.x.
> String s = hydrabad
> After reading a line from file.
> str = br.readLine().
>
> then use
> substring fun to find req. word.
>
>
> On 11/15/09, Siddhartha Ghosh 
> <[email protected]<http://in.mc953.mail.yahoo.com/mc/[email protected]>>
> wrote:
>>
>>   Hi All,
>> I am in need of some Java code (core Java) for file operations. Can nay
>> body help me out. I am not a a good Java code writer.
>> The work is like -
>> 1. a java file which will open a text file and then will do a string
>> search operation (1st for single words and then for two-words **) in the
>> text file.
>> 2. To do the search the key words the will be kept in two text files - one
>> for single words and another for two words.
>> * Single word key file -
>> Hyderabad
>> AP
>> festival
>> sports
>> *two words key file -
>> Hyderabad City
>> AP Govt.
>> Winter Festival.
>> etc
>>
>>
>>
>> *Siddhartha G*
>> *Hyderabad*
>> *Mobile:+91-9959613556*
>>
>>
>>
>>
>> ------------------------------
>> The INTERNET now has a personality. YOURS! See your Yahoo! 
>> Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
>> .
>
>
>
> ------------------------------
> The INTERNET now has a personality. YOURS! See your Yahoo! 
> Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>
> .
>



-- 
Akash Jajoo
UG Student , Final Year
Information Technology
NIT Durgapur

Reply via email to