web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to convert Text file of binary to normal?

(0) ShareShare
ReportReport
Posted on by 1,385

Hi Friends,

I wrote a job in AX for writing a text file with fixed field width. I need to read the file using the other application. Seems the text file is binary. I assume because of this the other application is not able to read. Below is the piece of code I wrote:

TextIo f = new TextIo(@"D:\AX\input.txt", 'w');

Am I going wrong somewhere?

Thanks,

Aarvi.

*This post is locked for comments

I have the same question (0)
  • Barney LEE Profile Picture
    60 on at
    RE: How to convert Text file of binary to normal?

    Converting text to binary file can be acomplished by using a mature text editing tool. And besides, use a robust text and image converting and editing application, text to other image or documents conversion is availabe, such as use a tiff converter to transform convert tiff to text ot text to tiff.

  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at
    RE: How to convert Text file of binary to normal?

    Hi Aarvi,

    Which versions of AX are using? If 4.0 ot later, the issue might be releated to the file being created in UniCode.

    Here is a couple of pointers from MSDN:

    The TextIO constructor has an additional optional parameter to set the code page of the file.

    The TextIO.new method has an optional argument that specifies the code page of the file. The default value is UTF-16LE (the Microsoft Windows native Unicode representation). It is best to use this in most instances, especially if end-users might edit the file in a text editor outside Microsoft Dynamics AX. For more information, see TextIo.new.

    When files are read, TextIO examines the first few bytes of the file for a byte-order mark (BOM) and automatically handles UTF-8, UTF-16LE, and UTF-16BE. If no BOM is found, the file is assumed to be in the ANSI Code Page (ACP) format.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Community Member Profile Picture

Community Member 2

#2
Mea_ Profile Picture

Mea_ 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans