• Post Reply Bookmark Topic Watch Topic
  • New Topic

Modifying Text File  RSS feed

 
A Agrawal
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading from a text file and I need to change some data on run.
I mean, while reading If I encounter a particular string I need to replace it by another String.
Please suggest, which Stream/Reader I can/should use for this purpose.
Thks.
------------------
Amit Agrawal,
New Delhi, India.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, which you agreed to when you registered, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Ganesh Ram
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that comes to mind is Random Access File but it is pretty inefficient.
 
A Agrawal
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Carl,
I know I am talking to Sheriff, but I don�t think there is any problem with my User Name.

1) From Your mail:
�We require names to have at least two words, separated by a space,�
In my case: Yes. It Is.
2) From Registration Screen:
�No commas or underscores, and the last name must be more than one letter�
In My case: Yes. It Is.
More over I give my complete name and location in my signature so where is the problem and The User name I have given here is the Name, I am known even in my co. Still If you think its not acceptable please feel free to go ahead and ban my Id, I promise not to come back.

Originally posted by Carl Trusiak:
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, which you agreed to when you registered, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.


------------------
Amit Agrawal,
New Delhi, India.
 
satish bora
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File Reader/Writer (As you are using the text file) and String Tokenzier should serve the purpose.
Cheers,
Satish
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!