You could write a C/Java/Perl program that would do the work for you and then invoke it from oracle. Volla!

Sam