Skip to main content.
Index | Support | Documentation | FAQ

Combining Premvet with an external Word Processor for merging.

Some of the options within the main veterinary software allow you to store the output of a report onto the hard disk: mainly client lists, overdue recalls and the report generator.

This output can be merged using the 'merge print option' within the Premvet software. However, more and more practices are using an external word processor to improve document appearance.

The document is aimed at giving you some pointers as to how to do this.

Data file:

The contents of the data file will vary depending on the option used to generate it. In general it will look like this:

1,MR TOM MELVIN,12 Hillside,Colchester,Fido,GSD,CANINE,765.9,...  
4,MISS E.R. SMITH,2 High Street,Stanway West,Fred,GSD,CANINE,0...  

As you can see the file is made up of selected fields separated by a comma (the delimiter) this symbol is used to separate the fields and will not be printed. If you feel confident you may use a word processor (Word, WordPerfect, etc.) in non-document mode (with WordPerfect you should use the Text In/Out option) to tidy up the data if required. Please do NOT use the Vet system's text editor as this will corrupt the data file as it is not suitable for use on files larger than 70 lines. Be careful to ensure that the fields contain the correct data and that each field is separated by the delimiter.

The data file generated in client lists is as follows:

Field Description Example

#1 Computer Ref. Number 2
#2 Client Name MR WILLIAMS
#3 Address line1 2 Lower Hill Road
#4 Address line 2 Newcastle On Tyne
#5 Animal name Max
#6 Breed DSH
#7 Species FELINE
#8 Balance Due 9.34
#9 Last consultation date 24.06.94
#10 Age of debt 30
#11 Address line 3 Lampeter
#12 Address line 4 LLANYBYDDER
The layout in overdue recalls is similar:
Field Description Example
#1 Computer Ref. 12
#2 Client Name Mr Smith
#3 Address line 1 15 Hawkwood Rise
#4 Address line 2 High town
#5 Animal Name Woodstock
#6 Address line 3 Dalkeith
#7 Address line 4 EH12 3SE
#8 Species canine
#9 Recall Type vaccination
#10 Last recall date 27.02.90
#11 Overdue by (days) 0

With the report generator you should use the summary page produced to give you the order the fields are in.

File location:

All merge compatible files generated via client lists & overdue recalls are automatically stored in the 'text' sub-directory and have the suffix '.csv' added. The report generator's 'ASCII' output is a little more flexible in that the delimiter can be changed. In addition, the files are stored in a sub-directory called 'report'. The summary page will give you the filename you should use.

WordPerfect for Unix

You should, first of all, go into setup as explained on page 364 of the WordPerfect manual and set the field delimiter to a comma (,) and the record delimiter to <CR>. This will enable WP to parse the data file correctly.

You create the 'primary' file with Word-Perfect as a normal document using <SHIFT> <F9> to insert merge fields as required. These merge fields are numeric, the number being the position that the item appears at in the data file.

So, in order to get the address and client name, using the client lists data file you would start with:

{FIELD}2~ 
{FIELD}3~ 
{FIELD}4~ 
{FIELD}11~ 
{FIELD}12~ 

Dear  {FIELD}2~ 

It is time for {FIELD}5~ to .... 

Once the primary file (letter) has been saved to merge in the data file you:

Using a DOS Word processor

If you have a word-processor running under MSDOS you can transfer the data file from Unix to DOS and process it there. The command for copying is 'doscp'. You should put a DOS formatted floppy in the drive and type: 'doscp /usr/vet/text/names.csv b:' (or a: depending on which drive you are using). This file can then be copied to the appropriate sub-directory on the DOS machine. You should refer to the word processor documentation for details of the actual merging.

If you want to send us a note of the procedures involved we can include it in this document for other practices' benefit.

Manipulating the data

Unix has a rich set of tools for manipulating text files. These can be used to filter the data file. One of the most versatile is the 'grep' command - grep will output any lines matching a specified criterion. Why would you want this? - The main use will be in restricting the list to a specific area. Many of you will be entering address details in any old order e.g. town on line 2 OR line 3, postcode on Line 3 or 4 etc. Restricting the search with client lists can be a bit cumbersome. It is also a lot quicker to dump the full client database into a text file and use grep to search it than running the client list program multiple times.

You specify the search criteria, data file e.g.

grep 'High Street' names.csv 

This will display all lines that contain High Street on the screen. You can re-direct the output to another file e.g.

grep 'High Street' names.csv > pass1.csv 

You would then use 'pass1.csv' as the secondary filename

Or to extract only those recalls relating to vaccination you could use:

grep 'vacc' recall.csv.

Grep commands are given from the operating system command line i.e. the $ prompt. The easiest way is to exit the vet system (or press <F6> from a menu). To save typing the full pathname it is easier if you move to the location of the data files with 'cd /u/vetdata/text' (or wherever the file is stored). Grep is case sensitive. You can tell it to ignore this by specifying the '-y' flag e.g.

grep -y 'high street' names.csv 

There is another grep called 'egrep' that can be used to find multiple occurrences in a line e.g.

egrep 'EH21|EH22|EH23' names.csv 

will list all lines containing the postcode EH21 or EH22 or EH23.

Using grep as a filter you can easily modify the data file to meet your needs. If you want further information on grep you can either look in the Unix manual or type

man grep 

at the $ prompt.

Word for Windows

To use the file for merge-printing with Word for Windows, the procedure is as follows: