The nrio.utils.ImportExport class can be used to convert databases from foreign file formats to MaxBase native file format (.DAT) and viceversa.
As of today the following methods are implemented:
datToDt2 Converts a file from DAT (RXDbase files prior to 2.04) to DT2 (current file format).
dbfToDt2 Converts a file from DBF to DT2.
dt2ToDbf Converts a file from DT2 to DBF.
csvToDt2 Converts a file from CSV (Character Separated Values) to DT2.
dt2ToCsv Converts a file from CSV (Character Separated Values) to DT2.
qifToDt2 Converts a file from QIF (Quicken Interchange Format) to DT2.
boolean dbfToDt2(String InputFile, String OutputFile, boolean bImportDeleted)
This method converts the DBF InputFile file into a DT2 OutputFile file. The method returns true if the conversion has been succesful, false otherwise. Please note that after the conversion is finished, you will only have one indexed field -- feel free to change fields indexing as needed. One more note: if bImportDeleted is set to true, all of the records present in the DBF file will be imported, otherwise deleted records will be skipped.
boolean datToDt2(String InputFile, String OutputFile)
This method converts the DAT InputFile file into a DT2 OutputFile file. The method returns true if the conversion has been succesful, false otherwise. The amount of information carried by DAT files is the same as DT2, therefore the conversion will keep existing indexes, names and field lengths. Note however that since ISAM indexes are not used anymore in DT2 files (the current file format for RXDbase dbs), they will be transformed into the correspoding B+TREE ones (keeping null/duplicate statements).
boolean dt2ToDbf(String InputFile, String OutputFile)
This method converts the DT2 InputFile file into a DBF OutputFile file. The method returns true if the conversion has been succesful, false otherwise.
boolean csvToDt2(String InFile, String OutFile, char SepChar)
This method converts the CSV InFile file into a DT2 OutFile file. The method returns true if the conversion has been succesful, false otherwise.
boolean dt2ToCsv(String InFile, String OutFile, char SepChar)
This method converts the CSV InFile file into a DT2 OutFile file. The method returns true if the conversion has been succesful, false otherwise.
What is a CSV file? It is a file that holds a record for each line of which it is composed, with a special character acting as a separator between each field. Please note that after the conversion is finished, you will only have one indexed field -- feel free to change fields indexing as needed.
boolean qifToDt2(String InFile, String OutFile)
This method converts the QIF InFile file into a DT2 OutFile file. The method returns true if the conversion has been succesful, false otherwise.
As of today, the routine has been tested only on Asset Accounts ("Oth A" in QIF jargon) because I only had those for my tests. If you find problems with other types of QIF files, let me have a testcase with the failing example and I'll update the method. |