Daniel Ignat wrote:
> 
> i'm new in java .. and i need some topic for create a little programm
> i need to formating a file for insert in a database: (/var/log/message)
> 

You could just open the file using java.io.File, read it in, then write
the new file in some directory this program would have write permission
to (dependent on the user it runs as). If you need to enclose the
messages in quotes (as in your example), you probably want to use a
StreamTokenizer to get each line as a String (there's probably a much
better way to do this, but I'm very busy and frazzled with Sun's
Developer certification exam right now). Once you've got each message as
a String, you can writeUTF() into the new file and add the quotes at
each end.

I'm not sure how much processing you need to do on it, though.


-- 
Jeff Galyan
http://www.anamorphic.com
http://www.sun.com
jeffrey dot galyan at sun dot com
talisman at anamorphic dot com
Sun Certified Java(TM) Programmer
======================================================================
Linus Torvalds on Microsoft and software development:
"... if it's a hobby for me and a job for you, why are you doing such a
shoddy job of it?"

The views expressed herein do not necessarily reflect those of my
employer.

Sun Microsystems, Inc., has no connection to my involvement with the
Mozilla Organization.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to