[EpiData-list] Export to excel with Filter using Checkcode

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Mon Feb 8 08:30:22 CST 2010


Hi

Just sharing my experience with the users here in calling Export command of Epic from check file in Epidata


The Dos command looks like this 

c:\EpiC e excel d:\ves101\ves101.rec d:\ves101\VIV02081919_FARI.xls filter="fari1yes2n=1" DELETED REPLACE

However when I try the same in the check file, the filter did not get applied
My check file looks like this

sourcedir = "d:\ves101\"
INVES2 = COPY(INVESTIGAT,1,3)
mth2 = string(month(today))
d2 = string(day(today))
hr2 = string(hr)
mins3 = string(mins2)
recfile = sourcedir+"ves101.rec"
fariout = sourcedir+INVES2+mth2+d2+hr2+mins3+"_FARI.xls"
execute c:\epic.exe "e excel @recfile @fariout filter="fari1yes2n=1" DELETED REPLACE" wait

The EpiC.log file shows the following
Command:        EpiC e excel d:\ves101\ves101.rec d:\ves101\VIV02081928_FARI.xls DELETED REPLACE
2/8/2010 7:29:15 PM
Exporting d:\ves101\ves101.rec to d:\ves101\VIV02081928_FARI.xls
Exports to:     Excel
Records:        All
Filter:         None
Deleted records in inputfile are included in export
7 records with 18 fields exported


I can see that the " " around the Filter are creating the problem. Single quotes did not work

Command:        EpiC e excel d:\ves101\ves101.rec d:\ves101\VIV02081952_FARI.xls filter='fari1yes2n=1' DELETED REPLACE
2/8/2010 7:52:25 PM
Exporting d:\ves101\ves101.rec to d:\ves101\VIV02081952_FARI.xls
Exports to:     Excel
Records:        All
Filter:         'fari1yes2n=1'
Deleted records in inputfile are included in export
0 records with 18 fields exported

Finally what did the trick was simply to remove the ""

execute c:\epic.exe "e excel @recfile @fariout filter=fari1yes2n=1 DELETED REPLACE" wait


EpiC Log shows:
Command:        EpiC e excel d:\ves101\ves101.rec d:\ves101\VIV02081955_FARI.xls filter=fari1yes2n=1 DELETED REPLACE
2/8/2010 7:54:38 PM
Exporting d:\ves101\ves101.rec to d:\ves101\VIV02081955_FARI.xls
Exports to:     Excel
Records:        All
Filter:         fari1yes2n=1
Deleted records in inputfile are included in export
5 records with 18 fields exported


I hope this information would be of use to some of the members. Am psoting it as searching through the archives did not yield much.

Another thing I noted was that the Zip files created by EpiC can not be opened by WinRAR or PkZIP on my machine though EPiC can extract the same just fine.

Thanks
,Dr. Vivek Gupta, MBBS, MD (Community Medicine)All India Institute of Medical Sciences
New Delhi.
Phone: (+91)9899410420
Alt. E-mail:  drvivek(dot)gupta(at)gmail(dot)com




      


More information about the EpiData-list mailing list