Check the following example for UTL_FILE usage.

http://www.jlcomp.demon.co.uk/faq/utl_file.html