you can try the package UTL_FILE.