Hey, quick post here to show you what I had to learn the hard way.

Problem: someone sends you a song in ChordPro format (or other formats that basically use ChordPro notation, like from OnSong or SongBook, etc.)  It has all the chords in it but you also or you only need the lyrics (without chords!)

Removing them can be tedious.

Solution: If your editor supports Regular Expressions (regex) for search and replace, you can do the following:

Search string:

^(.*)?\[.+?](.*)?$

Replace string:

\1\2

Caveats:

  • I only tested this with Notepad++
  • The syntax for the replace string might vary between editors.  This is for Notepad++, where each numbered place-holder in the replace string corresponds with one of the (.*) groupings
  • This removes one chord per line.  This is not a real problem.  If you do a “replace all” you replace one chord in all the lines and clicking that button several times will have done the trick fairly quickly.

Multiple files: While not tested, Notepad++’s “Find in Files” tab on the search/replace dialog should do the trick or equally the “Replace in all opened files” button on the Replace tab of the search/replace dialog.

0 Comments

Archives

Categories

Important links

leighweb.com – our family web site
surleslinteaux.leighweb.com – my wife’s French Sunday School blog
eglisejosue.fr – our church in France
tdr-guebwiller.eu – our house of prayer (HOP) in France
informatique.leighweb.com – My web development freelance business
My CV/Resume in English (PDF)