Find number betwen commans



  • 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



  • @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.


Log in to reply