pythonnotepad++additionletter-spacing

How to add a space if 2 conditions are met from a wall of text file?


I have a .txt file that has stock tickers such as $AAPL, but the issue is that these tickers are stuck to other words such as "$AAPL24H" but instead I want it to be "$APPL 24H" so essentially I want python or some sort of text editor to go ahead and look at a .txt file > every time it sees the symbol "$" > it should move 4 letters > and then enter space

So that $APPL24H > turns into $AAPL 24H if that makes sense.

I have 0 programming but I was hoping you guys can hook me up with a YouTube video that would help me out here? Thanks!


Solution

  • Using Notepad++.

    Explanation:

    \$          # $ sign, have to be escaped as it has special meaning in regex
    ....        # 4 any character but newline
    

    Replacement:

    $0          # the whole match followed by a space
    

    Screenshot (before):

    enter image description here

    Screenshot (after):

    enter image description here