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

Announcements

News and Announcements icon
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
    240,059 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,907 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,907 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans