Results 1 to 2 of 2
Thread: Editing a text file
- 02-11-2013, 09:41 PM #1
Member
- Join Date
- Feb 2013
- Posts
- 19
- Rep Power
- 0
Editing a text file
I'm trying to make a program that edits the text from a file and saves the text with a different name. I know how to copy the file with a different name, but I don't know how to alter the text inside it.
Lets say I have a file called MyTextFile.txt with the content "abcd". I want the program to create a file called MyTextFileModified.txt with the content "bcde"
Also, I'd like it to work for long files, and maybe for word files.
- 02-12-2013, 12:31 AM #2
Senior Member
- Join Date
- Oct 2011
- Location
- Sweden
- Posts
- 123
- Rep Power
- 0
Re: Editing a text file
So, do you want it to change it to 'bcde' every time or do you want it to be something that you decide upon?
What is a long file?
What is a word file?
You can always read line by line using a BufferedReader + FileReader and get the content of a .txt-file. If you know how to work with files I'm sure you'll be able to do this.
If you want to read MS Word documents, have a look at the POI API - Apache POI - the Java API for Microsoft Documents
Similar Threads
-
Simple Text File Editing in Java help
By DMarsh12 in forum New To JavaReplies: 1Last Post: 10-22-2011, 09:55 PM -
editing a file. Am I doing this right?
By Mokomi in forum New To JavaReplies: 2Last Post: 10-14-2011, 04:40 AM -
Editing text files
By NickBru in forum New To JavaReplies: 4Last Post: 12-05-2010, 06:27 PM -
Text editing
By right2001 in forum New To JavaReplies: 1Last Post: 04-10-2009, 07:03 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks