Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting IBM DB2 IXF file to CSV or XML

Tags:

python

c#

csv

db2

How do I convert an exported IXF file (using db2 export) to a human-readable format, like CSV or XML? I am comfortable with doing it in Python or .NET C#.

like image 260
GPX Avatar asked Dec 28 '22 09:12

GPX


1 Answers

The PC/IXF format is fairly complex, and is practically unknown to programs outside of DB2. Writing your own PC/IXF parser just to convert an IXF file directly to some other format might take a while. A faster alternative is to issue an IMPORT command on the DB2 server and specify CREATE INTO instead of INSERT INTO , which will generate a brand new table that can accommodate the contents of the file being imported. This will allow you to run an EXPORT command on the new table to dump the rows to a delimited format.

like image 118
Fred Sobotka Avatar answered Dec 31 '22 13:12

Fred Sobotka