The Python Program?

Plugin help and Support

Moderators: webmaster, Christian, Kuok-Tim, ChrisClark, NACarter, Forum Support

The Python Program?

Postby b.lake » Wed Jan 05, 2005 3:20 pm

I have downloaded the files kindly produced by Nick Carter to enable Songs of Fellowship songs to be converted and loaded into Zionworx. I have run the .BAS file ok and now have lots of text files but that is were Nick's instructions seem to run out! Can someone please help me do the next bit i.e. use the Python program as I haven't got a clue what to do next to get all the individual text files into Zionworx! Thanks
b.lake
Junior
 
Posts: 2
Joined: Wed Nov 24, 2004 10:06 am

Help File

Postby NACarter » Fri Jan 14, 2005 9:45 am

I have just sent Edd the latest versions of my files, which includes a help document. It should appear on this site soon. If you can't wait, here's the text of my help document (the document contains images as well):

Steps to Create/Update the Zionworx Database
1. Create the individual files from the Word documents
The Word macro Â?ConvertSoFFile v3.basÂ? converts the SoF Word documents for volumes 1&2 (Vols1_2.rtf) and volume 3 (file sof3words.rtf) into separate text files in PowerWorship format. To import the macro into Word, open a document (any will do) and select Tools -> Macro -> Visual Basic Editor to open the macro editor. Then select File -> Import FileÂ? and then select the Â?ConvertSoFFile v3.basÂ? file. You should then have a macro called Â?ConvertSoFFileÂ? in your Normal template. Select File -> Close and return to Microsoft Word.
Copy the files Â?Vols1_2.rtfÂ? and Â?sof3words.rtfÂ? into a new empty directory and then open each Word document and run the macro for each one. Before running the macro you will need to edit the file slightly. Please see specific notes for each file:

Vols1_2.rtf
Before running this macro ensure that each song fits on a single page, and that lines do not wrap round. You can do this with Page Setup and set a custom paper size of width 40cm and height 55cm.
Also remove the lines at the bottom of each song saying "A Songs of Fellowship Worship Resource" and "CCL Licence number: ", using a replace all with nothing.

sof3words.rtf
Some songs don't have the number specified as text, but as a numbered bullet. Please change this first before running the macro. Go to the relevant line, turn off numbered bullets and insert the song number followed by a Tab. Ensure that you make the song number Bold. The following songs require this change: 1254 & 1273.
Once you have run the macro on the two files you should have a directory full of text files. These files are in the correct format for the freeware application PowerWorship, which creates PowerPoint presentations from the database (see http://www.powerworship.com/).

2. Convert the individual files into a single text database
This next step involves running a program called Â?Convert.pyÂ?, which is written in the Python programming language. You will need to have Python installed first Â? if you havenÂ?t you can download it (for free) from http://www.python.org/download/. Once Python is downloaded and installed simply double-click on Â?Convert.pyÂ? in a Windows Explorer window. That should then combine all of the separate files into a single text file called Â?SFDatabase.txtÂ?.

3. Open the text database in Access
Start up Access and then select File -> OpenÂ? Make sure the file type at the bottom of the dialog box is Â?Text FilesÂ? and then find and open the file created above (Â?SFDatabase.txtÂ?). The import wizard should then start. Follow these steps:
a) On the first page of the wizard ensure that Â?DelimitedÂ? is chosen.
b) On the second page, ensure that the controls are selected as shown below. The first few lines of the table should appear the same as in this diagram.
c) Just accept the default settings on the next page.
Depending upon your version of Access, you may well get another page asking about adding a primary key. You can tell it not to use a primary key.
You should now have a table called SFDatabase. This table now needs to be imported into the Zionworx database.
Open the Zionworx database and add the new songs
You may wish to play safe and copy the original Â?Songs.dbfÂ? file somewhere in case it gets messed up before you try this next step. In Access, open the Zionworx database Â?SongsÂ? by using File -> OpenÂ? and selecting the file type Â?dBase IIIÂ?. Now you should have another table called Songs. Now select all the songs you want from SFDatabase and copy and paste them into the Songs table. The last step is to select the Songs table and use File -> ExportÂ? to save the database. Use Â?dBase IIIÂ? format again in the export dialog.


Nick
NACarter
Junior
 
Posts: 21
Joined: Mon Apr 19, 2004 1:22 pm
Location: Romsey, UK

Postby Peter_in_Christ » Sat Jan 15, 2005 11:16 am

If you could send me a sample copy of one of the text files, I could develop a program (modified version) of txt2db to batch convert files produced by the python program and append it to the songs database or a database of your choosing.

This removes the tedious task of playing around with Access, and for those who don't have the Professional Version of Office.

This would complement NACarters Python Tool, as he has already worked out how to convert 'Songs of Fellowship' songs into txt files, and what my program would do is match the relevant fields from these text files and append them to the database.

I will have to find time to do this though at a later date...

Kind Regards,

Peter
\o/ The Lord is Gracious and Compassionate, Slow to anger and Rich in Love. \o/
Peter_in_Christ
Senior
 
Posts: 56
Joined: Tue Jan 13, 2004 12:04 am
Location: UK, London

Sample File

Postby NACarter » Mon Jan 17, 2005 8:44 am

Peter,

I'll try to send you a sample file sometime this week. I'm a bit busy at the moment, but may find some time on Thursday or Friday.

Nick
NACarter
Junior
 
Posts: 21
Joined: Mon Apr 19, 2004 1:22 pm
Location: Romsey, UK


Return to Songs of Fellowship

Who is online

Users browsing this forum: No registered users and 1 guest

cron