AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 22.11.2010, 01:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,491 / 846 (79) +++++++
Регистрация: 28.10.2006
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, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Importing two or more entities from a Single File Blog bot Dynamics CRM: Blogs 0 09.11.2010 19:05
daxdilip: Error message when you read an .XML file that has a large text field in Microsoft Dynamics AX 4.0 Blog bot DAX Blogs 0 15.08.2010 16:07
Microsoft Dynamics CRM Team Blog: Data Migration Manager Tips and Tricks Blog bot Dynamics CRM: Blogs 0 02.09.2008 22:05
How to read the data from an xmldocument navax1 DAX in English 1 24.10.2007 00:53

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:42.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.