Replace all characters of any type, before separator

Delebre
2013-07-07
2013-07-07
  • Delebre

    Delebre - 2013-07-07

    Hey guys! I looked around the forum here quite a while and didn't see exactly what I was looking for, so I am posting for help.

    I have a file that has information that has this kind of layout:

    These-are-Random123XYZ&.,characters:blah1blahblahblah20938493
    These-are-Random123XYZ&.,characters:blah2blahblahblah20938409328
    These-are-Random123XYZ&.,characters:blah3blahblahblah05-860o4530-59
    These-are-Random123XYZ&.,characters:blah4blahblahblah203i4092rt293i
    These-are-Random123XYZ&.,characters:blah5blahblahblah23094023j2j309
    These-are-Random123XYZ&.,characters:blah6blahblahblah20923rj23jfr9j
    These-are-Random123XYZ&.,characters:blah7blahblahblah90sdjkpok23ri
    These-are-Random123XYZ&.,characters:blah8blahblahblah-9fj23omfwdjf
    These-are-Random123XYZ&.,characters:blah9blahblahblahd-uif0wf092j3pof
    These-are-Random123XYZ&.,characters:blah0blahblahblahwe0fiwe9-kpowejf0
    These-are-Random123XYZ&.,characters:blah1blahblahblahe-9wfujw9-0efcpwmj
    These-are-Random123XYZ&.,characters:blah2blahblahblahwef-we-ckmewp

    As you can see, there are random characters/sentences on either side of the : symbol.
    What I would like to do is replace ANY characters BEFORE that : symbol.
    So after running whatever expressions (I am asking you guys for..) I would be left with this:

    blah1blahblahblah20938493
    blah2blahblahblah20938409328
    blah3blahblahblah05-860o4530-59
    blah4blahblahblah203i4092rt293i
    blah5blahblahblah23094023j2j309
    blah6blahblahblah20923rj23jfr9j
    blah7blahblahblah90sdjkpok23ri
    blah8blahblahblah-9fj23omfwdjf
    blah9blahblahblahd-uif0wf092j3pof
    blah0blahblahblahwe0fiwe9-kpowejf0
    blah1blahblahblahe-9wfujw9-0efcpwmj
    blah2blahblahblahwef-we-ckmewp

    Are there expressions I can use to delete any/all characters before the : symbol?

    Thank you for any help! This file is huge, and this is the only way I can do it without spending days and days on manually doing it.

     
  • Loreia2

    Loreia2 - 2013-07-07

    Hi Delebre,

    you can use RE search.

    Find what: "^.*?:" (use without quotes, that's caret, dot, star, question mark, colon)
    Replace with: \leave empty\ (if you wish to keep colon, place colon here)

    Tick regular expression check box,
    Don't select ". matches new line" check box.

    BR,
    Loreia

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks