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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How do I convert CSV file from Unix to Windows format?

(0) ShareShare
ReportReport
Posted on by 1,421

Hi all,

I need to convert a CSV file, created in UNIX format, in a Windows format file in order to run, from code, the parsing of this CSV using the CommaTextIo class. The format of Windows and UNIX text files differs slightly. In Windows, lines end with both the line feed and carriage return ASCII characters, but UNIX uses only a line feed. As a consequence, some Windows applications will not show the line breaks in UNIX-format files.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Wouldn't it be enough if you set '\n' to inRecordDelimiter() (instead of '\r\n')?

  • Community Member Profile Picture
    on at

    You can use .NET classes like TextReader. It can handle every format of lines.

  • Douglas Noel Profile Picture
    3,905 on at

    Hi Giuseppe,

    please keep in mind, that the "Record Delimiter" often isn't the only problem you should circumvent. The character set is important too.

    regards

    Douglas

  • Giuseppe Caradonna Profile Picture
    1,421 on at

    @Martin, you're right. Is enough to specify the record delimiter (I had left the default).

    @Douglas, what do you mean with "character set"?

  • Douglas Noel Profile Picture
    3,905 on at

    Hi,

    Is it a fixes length character set (16bit,8bit) Unicode, or Ascii, or UNIX codepage ...., or is it a variable length charactrer like utf-8

    Maybe you have to do some conversions (or let the "WhateverIO class help you by specifying the character set)

    regards

    Douglas

  • Giuseppe Caradonna Profile Picture
    1,421 on at

    At this moment I don't have these informations. The only information that I have are the file format (does not change), the field delimiter is the semilon and that does not contain special characters.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi

    You probably need to investigate the code page of the UNIX file in order to have correct reading of the file:

    https://msdn.microsoft.com/en-us/library/aa881745.aspx

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans