Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2006

Tip: Looking for answers? Try searching our database.

Regular Expressions

Thread view: 
hshirani@gmail.com - 08 Sep 2006 07:36 GMT
Hi,

I want to find some regular expressions in a file using java. I used
MappedByteBuffer in order to read the file (I do not want to read the
file line by line) but the problem is that I can not delete the file
after do the mapping between file and memory. Is there any way to
delete a file after do such a mapping? or read a file for regualr
expressions without using MappedByteBuffer? Thaks for your help.
Kris Krason - 08 Sep 2006 08:05 GMT
Dnia 08.09.2006 hshirani@gmail.com <hshirani@gmail.com> napisał/a:
> Hi,
>
[quoted text clipped - 4 lines]
> delete a file after do such a mapping? or read a file for regualr
> expressions without using MappedByteBuffer? Thaks for your help.

I don't get it, why would you want to start reading a file and while at it,
delete it ?

Are you trying to do this? :
- read a file into memory
- delete the file (it was probably a temporary one)
- do a multiline regexp search/replace on it

If so, then I would use StringBuilder and FileReader (or buffered one) to get
every character in a String, close the file, delete it and then do the regexp.

Signature

Kris Krason
www.coderookie.com  - programming for newbies by noobs ;)
krisreviews.com - book reviews (computing, fantasy, science-fiction)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.