Delete text before spaces(tab) using regex

5,391

Use Replace, select the Regular Expression option, enter

^.* + (if you only need to remove spaces)

or

^.*[ ,\t]+ (if you need to remove tabs also)

in the "Find what" field and nothing in the "Replace with" field

Caveat: If you have a line like

1234 afe ngh

only ngh would remain

Share:
5,391

Related videos on Youtube

Perkan
Author by

Perkan

Updated on September 18, 2022

Comments

  • Perkan
    Perkan over 1 year

    I have a small problem.Tried looking for some solutions but couldn't find any. I have a big document that has data like this:

    0002ssap    10763
    0003    0003
    0003    33699425
    0003    3557471
    00031   00000
    

    I want to delete everything before the 2nd text part so it looks like this:

    10763
    0003
    33699425
    3557471
    00000
    

    Thanks

  • Perkan
    Perkan almost 7 years
    I tried your solution but I end up with something like this prntscr.com/f8te9e It says 87 occurrences but the document has few million lines and every line is similar (data1 data2)
  • whatever
    whatever almost 7 years
    mhh, could it be many of these are actually tabs and not whitespaces? In that case try ^.*[ ,\t]+. You can check whether they are tabs or whitespaces by selecting "Show All characters" from the View-> Show Symbol menu
  • Perkan
    Perkan almost 7 years
    The second solution worked like a charm. Thanks for the help, You saved me few years of work :D
  • whatever
    whatever almost 7 years
    You're welcome. :) Will edit the answer