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 :
Small and medium business | Business Central, N...
Suggested Answer

How to delete special charatcters while importing txt file

(0) ShareShare
ReportReport
Posted on by

I am trying to import txt file and iam getting an error

pastedimage1671686919769v1.png

And I tried to delete this character in the XML port and iam getting different error 

pastedimage1671687262089v1.png

 trigger OnOpenPage()
    var
        String: Text;
        Where: Text;
        Which: Text;
        NewString: Text;
        Text000: label 'Achtung';
        Text001: Label '>%1< is transformed to >%2<';
    begin
        String := Text000;
        Where := '<>';
        Which := '';
        NewString := DelChr(String, Where, Which);
        Message(Text001, String, NewString);
    end;

How can i remove this 2 ''  character while importing XML file any help will be great, Thanks in Advance.

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    Please share your complete code.

    Thanks.

  • Community Member Profile Picture
    on at

    This is my code I have written and I have my XML ,table, page, Iam trying to test this code on open page if it works there then i will add it on the XML port on after get record,

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    but this string Text000: label 'Achtung'; does not have '', how you can remove that?

  • Community Member Profile Picture
    on at

    In the code I have written this when copied the code it shows as blank.

    tw.jpg

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Yes its blank as a string, you can not remove blank if you wan to remove try this

    keepTxtChars := ‘1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz’;

    newstring := DELCHR(string,’=’,DELCHR(string,’=’,keepTxtChars));

  • Suggested answer
    pankaj.k Profile Picture
    994 on at

    Hi sainudheen,

    Please check the below link that will help you to How to work All String  Function.....

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/text/text-delchr-method

    https://learn.microsoft.com/en-us/dynamics-nav/delchr-function--code--text-

  • Community Member Profile Picture
    on at

    Thanks the quick response Nitin Verma Yes, I tried This on XML port on trigger after get record but still the error pops up

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Try this.

    keepTxtChars := '''';

    DELCHR(string,'=',keepTxtChars)

  • Community Member Profile Picture
    on at

    Its working on open page

    but  during the import its still the same error

    i have added in on trigger OnAfterGetRecord()

    but here no record is getting so its not working is there any  other alternative solutions for  it.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans