Thursday, May 27, 2010

create comma seperated file.

Use CommaIO file to create comma separated records or create CSV file.

create an instance of CommaIO and provide the operating mode.

These are the following modes, you can find it in FILE Macro under io_write.
'R' - Read
'W' - Write
'A' - Append
'T' - Translate
'B' - Binary

You need to assign the value of inrecorddelimeter.
and then use write method to write it. Multiple arguments can be passed in the write method of CommaIO.
CommaIO commaIO;
CustTable custTable;

//File name with the operating mode append.
commaIO = new CommaIO(@"C:\Cust.txt", 'A');
commaIO.inRecordDelimiter('\n');


while select CustTable
{
commaIO.write(custTable.AccountNum,custTable.AccountStatement, custTable.CashDisc);
}
Find the sample here.

No comments:

Post a Comment