Class AbstractCSVFile

All Implemented Interfaces:
IPersistence, AbstractDataObject, ICBLBeanNGroup, ICBLContainer, IFieldContainer, ISMBean, ISMDataType

public abstract class AbstractCSVFile extends SequentialNIOFile
This class is designed to provide a migration path from SequentialFiles to CSV format. To use : Change the superclass of a persistence file from SequentialFile (or SQLWrapper) to AbstractCSVFile To migrate the data between two formats of the persistent class, two different classes would be required for the same data.
For example, lets say there is a "SequentialClientFile" class inheriting from SequentialFile,
Now we can create a new version called "CSVClientFile" (inheriting from AbstractCSVFile)
Next we have to instantiating the two classes, moving data from sequential to CSV version and saving it.
Here is a migration Example:

    SequentialClientFile sequentialClientFile = new SequentialClientFile(null); 
    CSVClientFile sequentialClientFile = new CSVClientFile(null);
    
    // Tell system where to load save/data 
    sequentialClientFile.assignFileName( "C:/temp/SEQ_clientFile.txt" );
    csvClientFile.assignFileName( "C:/temp/CSV_clientFile.csv" );
    
    // Open the files for read/write
    sequentialClientFile.open(IPersistence.OPEN_MODE_INPUT);
    sequentialClientFile.open(IPersistence.OPEN_MODE_OUTPUT);
    
    while (sequentialClientFile.next()) {
        // copy the data from sequential to CSV Format
        csvClientFile.setValue( sequentialClientFile.getValue());
         
        // write the data to disk
        csvClientFile.insert();
    }
    
    // finally close the files
    csvClientFile.close();
    sequentialClientFile.close();