Quantcast
Channel: Dynamics User Group
Viewing all articles
Browse latest Browse all 15740

Inserting text qualifier when importing CSV file

$
0
0

Hi , 

Just wondering if someone can help me please . I am importing a CSV file in Axapta 3.0 using AsciiIO class. The problem i am facing is that some of my text include an extra comma in it like

Cust, Cust Address,City

AX001,"House 2, Green Street",London,

can someone please tell me how can i mention a text qualifier " so it could  eliminate the extra comma from address field. 

my code is 

static void Job115(Args _args)

{

    AsciiIO                 AsciiIO;

    Container               c;

    str                     Location;

    ;

    location = "C:\\Temp\\Ebay\\Sales Order\\Order.csv";

    AsciiIO = new AsciiIO(location,"R");

    AsciiIO.inFieldDelimiter(',');

    c = AsciiIo.read();

    while(AsciiIO.status( )== IO_Status::Ok)

    {

 

        info(strfmt("1 %1 | 2 %2 | 3 %3 | 4 %4 | 5 %5 | 6 %6 | 7 %7 |",conpeek(c,4),conpeek(c,5),conpeek(c,6),conpeek(c,7),conpeek(c,8),conpeek(c,9),conpeek(c,10)));

        c = AsciiIO.read();

    }

 

}

Thanking you in anticipation 

 


Viewing all articles
Browse latest Browse all 15740

Trending Articles