Batch edit song database to remove verse tags [Vx]

edited November -1 in General Discussion

 

My song database contains old Verse tags [V1] from the previous presentation system and that is very annoying when they are visible on the presentation screen. See example below. Removing these verse tags manually would take alot of time. Has anyone got a good idea how to batch remove all these old verse tags in the OpenLP 2.0 database?

---[Vers:1]---

[V1]

Can you hear? There's a new song

Breaking out from the children of freedom

Every race and every nation

Sing it out, sing a new hallelu - jah. Yeh

---[Vers:2]---

[V2]

Let us sing love to the nations

Bringing hope of the grace that has freed us

Make Him known and make Him famous

Sing it out, sing a new hallelu - jah. Yeh

Comments

  • edited July 2011

    "SQLite Manager" is firefox plugin that you can use to manual edit the database file. Someone could say exactly what statement you can use.

  • edited July 2011

    This is not as simple as that as the verses are stored in an XML document in the database.  The tags you refer to are attributes of the XML document so simple SQL will not help.

  • edited July 2011

    Here is the statment that you can use to remove the strings that you don't want.

    <statment>

    UPDATE songs SET lyrics = Replace(lyrics, '[V2]', '')

    <statment>

    In bold is the statement that must be executed.

    [V2] is the statment that you dont want, and in the sigle brackets is the string that will be added. In this example there in no string.

  • edited August 2011

    Wow thanks. That sql statement worked perfectly to remove the tags.

    I used WinSQL and set up a SQLite3 Datasource to the song database file songs.sqlite , and that worked very well.

    Just one little thing. I manage to remove the verse tags, but I'm not able to remove the empty line that it leaves. Any idea how to include the line feed just after the the '[V2]' tag in the replace statement?

Sign In or Register to comment.