// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // ! This script is provided "as is" by Applied Maths. ! // ! You are free to use and modify this script for your own needs. ! // ! Redistribution or reproduction of the script is prohibited. ! // ! DISCLAIMER: ! // ! Improper use of scripts may corrupt your database. ! // ! Running this script is entirely at your own responsibility. ! // ! Applied Maths accepts no lialibility for any consequences ! // ! resulting from its use. ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! integer i,j,exportmetrics; DIALOG dlg; string experlist,expername; string key,field; string filename; FILE fl; FPRINT fp; float ps,h,w,mtr,vol,cnc; for i=1 to DbGetExperCount do if dbGetExperClass(i)="FPR" then { if length(expername)=0 then expername=DbGetExperName(i); experlist=experlist+DbGetExperName(i)+" "; } DlgAddText(dlg,"This script will export the database fields~nand band metrics of the currently~nselected entries",15,15,250,45); DlgAddText(dlg,"Select a fingerprint type:",15,72,150,15); DlgAddList(dlg,experlist,expername,15,90,150,150,"LIST"); DlgAddCheck(dlg,"Use metrics",exportmetrics,180,120,100,15); if not(DlgShow(dlg,"Export band metrics",280,268)) then stop; filename="result.txt"; if not(FilePromptName("Enter a name for the export file",filename,0)) then stop; if not(FileOpenWrite(fl,filename)) then { message("Unable to create this file!"); stop; } for i=1 to DbGetEntryCount do { key=DbGetEntryKey(i); if DbGetSel(key) then { for j=1 to DbGetFieldCount do FileWrite(fl,DbGetField(key,DbGetFieldName(j))+" "); FprLoadNorm(fp,key,expername); for j=1 to FprGetBandCount(fp) do { if j>1 then FileWrite(fl,", "); if not(exportmetrics) then { FprGetBandInfo(fp,j,ps,h,w); FileWrite(fl,str(ps,0,2)); } if exportmetrics then { FprGetBandQuant(fp,j,mtr,vol,cnc); FileWrite(fl,str(mtr,0,2)); } } FileWriteLine(fl); } } FileClose(fl); execute("notepad.exe "+filename);