Community
    • Login

    Find number betwen commans

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 298 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.
    • Toze CerdeiraT Offline
      Toze Cerdeira
      last edited by

      I have this file:

      [p2,115,0,4,] Steel Drums
      [p2,116,0,4,] Woodblock
      [p2,117,0,4,] Taiko
      [p2,119,10,4,] Sine Perc.
      [p2,118,0,4,] Melo. Tom 1
      [p2,118,18,4,] Jungle SD

      How to subtract “1” to the first value between comans

      ,115,
      ,116,
      ,117,
      ,118,
      ,118,
      etc

      Thanks

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Toze Cerdeira
        last edited by

        @Toze-Cerdeira

        You would have to script a solution to that.
        A similar discussion that would show you how to do it is HERE.

        In your case your “find” expression could be: p2,(\d+), and you could replace with 'p2,' + str(int(m.group(1)) - 1) + ',' or something close to that; there are a few different ways to write these expressions.

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors