You can use dbms_metadata.get_ddl (Oracle's package). This does a decent job. Personnally, I like to have a single file for each table, trigger, procedure, etc ... You can spool each out to a file that matches the table_name itself ...
Let SQL write the sql for you ... ie:
select a.index_name,
CURSOR (select dbms_metadata.get_ddl ('INDEX', p.index_name)
from dba_indexes P
where p.index_name = a.index_name)
from dba_indexes a
where a.owner = 'SCHEMANAME'
select 'SELECT dbms_metadata.get_ddl('||''''||'TABLE'||''''||','| |''''||TABLE_NAME||''''||','||''''||'OPENBAR'||''' '||') FROM DUAL;'
FROM USER_TABLES;
HTH
Gregg