Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Write data from NAV to a CSV-file using UTF-8 format

Posted on by Microsoft Employee

Thema:

Write data from NAV to a CSV-file.

If I declare the File variable as a File I got wrong letters in CSV-file especially for Danish characters æ, ø and å.

Therefore I use an Automation

'Microsoft ActiveX Data Objects 2.8 Library'.Stream

Then I can encode the file in UTF-8-format.

 

The pseudo code is as following

 

CLEAR(FFile);
CREATE(FFile);
FFile.Open;
FFile.Charset('UTF-8');

Repeat

  FFile.WriteText(Data)

Until  end_of_data

 

The problem is that all data in CSV-file is in the same line instead of a line per data. No linefeed after exported data record

How can I avoid this ?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Write data from NAV to a CSV-file using UTF-8 format

    Probably this will solve your problem:  FFile.WriteText(Data,1)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans