Results 1 to 4 of 4
- 08-30-2011, 09:06 AM #1
Member
- Join Date
- Oct 2010
- Posts
- 25
- Rep Power
- 0
Find a text in a file and write a word following this word
Hi all,
I have a text file where I have to find a particular word1 and then add a word2 soon after this word. By using FileWriter I could do only writing to a file. But how to find the word and also followed by writing into it. Please help.
Thanks & Regards
- 08-30-2011, 01:58 PM #2
What is the program supposed to do? Insert a String into a text file at a specific location?But how to find the word and also followed by writing into it.
You need to read the file and copy its contents to a temp file, when at the location, write out the new word, then continue reading and copying the rest of the file. When finished, rename the original file or delete it and rename the temp file to the original name
- 08-30-2011, 04:36 PM #3
Member
- Join Date
- Oct 2010
- Posts
- 25
- Rep Power
- 0
Thank you for the help. I have already got the index number, where I have to enter the word. which command should I use to insert a word at that index number. I couldn't find one.
I look forward to a reply.
Thanks and regards
- 08-30-2011, 04:44 PM #4
Similar Threads
-
Get selected text from MS Word,browser,pdf file
By binhdinh0708 in forum New To JavaReplies: 2Last Post: 04-17-2011, 04:04 PM -
Count the frequency of the word in a text file instead of a sentence.
By bMorgan in forum New To JavaReplies: 3Last Post: 11-09-2010, 12:10 AM -
Reading first and last word of each line in a text file
By yap_1991 in forum New To JavaReplies: 3Last Post: 06-26-2010, 08:11 AM -
Help. Find a word and located sentences in the file
By rashad in forum New To JavaReplies: 1Last Post: 02-28-2010, 03:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks