Remove text in brackets from a text file?

facade
facade Posts: 6,895
Name Dropper First Post First Anniversary
Forumite
So I have some text files that have (text in brackets)  I want to delete all instances of these, including what is inside the bracket.

e.g
(Billy) What time is it?
(Julie) Quarter to three. (looks at clock)No, ten to

becomes
What time is it?
Quarter to three. No, ten to

Anything free that will do it?
I have textpad, notepad+ & libreoffice.

I searched and there are a few articles on removing square brackets text, but swapping the square bracket for curved ones doesn't work.
I thought I had it cracked with use regular expressions and "(.*)" but that successfully found everything and deleted it brackets or not


I want to go back to The Olden Days, when every single thing that I can think of was better.....

(except air quality and Medical Science ;))

Comments

  • Bradden
    Bradden Posts: 1,051
    First Post First Anniversary Name Dropper Photogenic
    Forumite
    Easiest solution i can think of is power renamer ... part of windows powerwtoys.

    https://learn.microsoft.com/en-us/windows/powertoys/

    https://learn.microsoft.com/en-us/windows/powertoys/powerrename
  • In notepad++ and similar you have to escape the special characters when doing a regular expression search

    so it’ll probably be something like this /(.*/)

    if it’s not / try the other slash. 
    PPI success. Banding success. Double Dip PCN cancelled! South facing solar (Midlands) and battery. Savings Session supporter.
  • facade
    facade Posts: 6,895
    Name Dropper First Post First Anniversary
    Forumite
    Bradden said:
    Easiest solution i can think of is power renamer ... part of windows powerwtoys.

    https://learn.microsoft.com/en-us/windows/powertoys/

    https://learn.microsoft.com/en-us/windows/powertoys/powerrename

    I have power renamer, I use it all the time, but these aren't filenames, it is text inside the file
    I want to go back to The Olden Days, when every single thing that I can think of was better.....

    (except air quality and Medical Science ;))
  • facade
    facade Posts: 6,895
    Name Dropper First Post First Anniversary
    Forumite
    In notepad++ and similar you have to escape the special characters when doing a regular expression search

    so it’ll probably be something like this /(.*/)

    if it’s not / try the other slash. 

    Thanks, the regular expression \(.*\) sort of worked in notepad++, it found and eliminated about half of them.
    It refuses to find the rest!

    I wondered if they were double width characters or something but regular search for ( finds them ok...

    I can find ( and then manually delete the rest but there are hundreds, and more than 1 file to do.



    Success!

    The program that generated the file in the first place (subtitle edit) does work if I use the regular expression \(.*\) in the editor.

    In fact it has a multiple find & replace that mixes text  and regular expressions so I can eliminate all bracket text (SDH comments) and squiggle note (music is playing) in one pass.

    Thanks for the help.





    I want to go back to The Olden Days, when every single thing that I can think of was better.....

    (except air quality and Medical Science ;))
  • Subtitle Edit is excellent. As well as the Multiple Replace it also has Tools - Remove Text for Hearing Impaired, which does exactly what you're trying to do with one click.
  • facade
    facade Posts: 6,895
    Name Dropper First Post First Anniversary
    Forumite
    Subtitle Edit is excellent. As well as the Multiple Replace it also has Tools - Remove Text for Hearing Impaired, which does exactly what you're trying to do with one click.
    So it does!
    I'd never read that far down Tools, but I suppose it is obvious that everyone would want that :smile:

    I've used it to convert Chinese PGS subtitles into passable English srt, which is pretty amazing really.

    I'm trying out out the speech to text right now!

    I want to go back to The Olden Days, when every single thing that I can think of was better.....

    (except air quality and Medical Science ;))
  • OCR to convert DVB subtitles to .srt is good, too. You need to have Tesseract OCR installed. 
    And check out the options under 'Fix common errors' - very useful.
  • facade
    facade Posts: 6,895
    Name Dropper First Post First Anniversary
    Forumite

    My clickbait feed on youtube is now suggesting videos on how to do this.

    Proof (if we needed it)  that any search done with google is captured to my profile and used across the platform.

    Default search engine now set to duckduckgo.
    I want to go back to The Olden Days, when every single thing that I can think of was better.....

    (except air quality and Medical Science ;))
  • forgotmyname
    forgotmyname Posts: 32,478
    First Anniversary Name Dropper First Post
    Forumite
    Gave up on Google search ages ago.  Trying to find historic data for a building and a village but all it kept feeding me was
    clickbait articles from a recent incident in the village.

    All local newspapers seemingly now only exists as online advert platforms to regurgitate the same error strewn non news articles.
    2 short lines of text and then 10 pages of clickbait adverts...

    over 70 claim all your tax back, you wont believe how much this cost, cars being given away for almost free... Do people really click
    that rubbish and expect an ounce of truth?

    Censorship Reigns Supreme in Troll City...

Meet your Ambassadors

Categories

  • All Categories
  • 341.6K Banking & Borrowing
  • 249.7K Reduce Debt & Boost Income
  • 449.1K Spending & Discounts
  • 233.8K Work, Benefits & Business
  • 605.9K Mortgages, Homes & Bills
  • 172.3K Life & Family
  • 246.7K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 15.8K Discuss & Feedback
  • 15.1K Coronavirus Support Boards