22.11.2010, 01:11 | #1 |
Участник
|
xplusplus: How to read data from text (.txt) file with AsciiIo
Источник: http://xplusplus.info/index.php/how-...-with-asciiio/
============== The AsciiIo object can be used to read and write text files within the AX runtime environment. It returns a container with the data in each line in the text file. That could be useful if you are reading a CSV file. In the following example I convert the container into text string and print it as an info message, line after line: void method1() { AsciiIo readFile; str line; container fileRecord; ; readFile = new AsciiIo("C:\\test.txt" , 'R'); readFile.inFieldDelimiter("1234567890abcdefghijklmnop"); fileRecord = readFile.read(); while (fileRecord) { line = con2str(fileRecord); info(line); fileRecord = readFile.read(); } } This is content of the text file: And that is the output generated with the code sample above: Источник: http://xplusplus.info/index.php/how-...-with-asciiio/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|