• Login
Community
  • Login

How to delete characters after certain number

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 152 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    Cristina Moise
    last edited by Sep 26, 2024, 9:29 AM

    Hi All,
    I would appreciate your help regarding my issue. I am struggling with a big xml File where I have below line, the commodity code should have only 8 characters but due to a system wrong setting it’s coming out with 10 numbers/characters so I manually have to replace each code by deleting the last two numbers and it takes me almost two days to do that.
    Can someone help me with this topic.
    <ProductCommodityCode>8414302090</ProductCommodityCode>

    Thank you

    A 1 Reply Last reply Sep 26, 2024, 10:10 AM Reply Quote 0
    • A
      Alan Kilborn @Cristina Moise
      last edited by Alan Kilborn Sep 26, 2024, 11:12 AM Sep 26, 2024, 10:10 AM

      @Cristina-Moise :

      Find: (?-i)<ProductCommodityCode>(\d{8})\d\d</ProductCommodityCode>
      Replace: <ProductCommodityCode>${1}</ProductCommodityCode>
      Search mode: Regular expression


      Will change, e.g.

      <ProductCommodityCode>8414302090</ProductCommodityCode>

      into

      <ProductCommodityCode>84143020</ProductCommodityCode>

      C 1 Reply Last reply Sep 26, 2024, 11:04 AM Reply Quote 3
      • C
        Cristina Moise @Alan Kilborn
        last edited by Sep 26, 2024, 11:04 AM

        @Alan-Kilborn Can’t say in words how much I love you right now.You made my day !! So happy!Again thank you for your prompt answer.

        1 Reply Last reply Reply Quote 1
        2 out of 3
        • First post
          2/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors