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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Importing Textfile with spezial Escape Sequence

(0) ShareShare
ReportReport
Posted on by

Hallo together,

i wan't to import an Textfile with special charakters in dynamics AX.

In this case the Charakter ' is normaly a Line-Delimiter.
 But it also can be in an text in Line. For Example "My name is 'name" in this case ther should not be an Line-Delimiter. In this case i'm getting the escape sequence & for this situation.

Example: "My name ist &'name.

Has anybody a solution how to realize this?


Many thanks in advanced.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    Using the inRecordDelimiter method you can specify another record delimiter.

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    CSV handles this by requiring double-quotes around "line breaks (CRLF), double quotes, and commas". Then it's valid to use line delimiters inside field values, such as "aaa {CRLF} bbb".

    Therefore using CSV format (and respecting its rules) should be a solution. And if you can't use CSV as such, you might be able to borrow its design decisions.

  • Mea_ Profile Picture
    60,286 on at

    Hi mikra,

    So you can read a file using TextIO msdn.microsoft.com/.../cc967403.aspx

    than you can split text using regular expression for example fourone.se/.../using-regular-expressions-in-dynamics-ax or parse it in any other way.

    What issue do you have ?

  • Community Member Profile Picture
    on at

    Many thanks for the replays.

    I want to Import an EDI File directly to danymics AX.

    The ' charakter is in EDI an Segment delimiter. But it can also be in an Text.

    In this case it is marked with the Escape Sequence &'.

    An example of looks like this.

    NAD+DP+123456789::9++Name+Street l ' casa+Cityp++ZipCode+Country'NAD+SU+123456::9'

    in this cas I have two segments. An NAD+DP and an NAD+SU Segment.

    Hope i have written course.

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    There is no direct support for EDI formats in AX, so unless you use another tool with EDI support to transform the data, you'll have to parse the text by yourself.

    You can easily write a regular expressions that accepts ' but not &'. Then you'll use this expression to split the text to segments.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You cannot resolve it this way with the regular infielddelimiter, if you do not have line breaks as well mentioned by Martin.

    If you always have a fixed amount of columns, then what you could do is just read in the whole file into a string/text buffer and parse it with strFind/strScan or regex to locate the first + or ' characters, the get a subStr of 1 to the position of the character found and store it for processing. You will repeat this until the number of columns you expect, after which you know a new "line" is coming.

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Unfortunately EDI message formats are not fixed-length; they use all kinds of weird delimiters, often on a single long line without line breaks. Designed in 1980'. :-)

  • Community Member Profile Picture
    on at

    Thanks for your help.

    I think i have an solution. I will import the textfile over System.IO.StreamReader.

    In the import i am parsing the text.

    Thanks again.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans