* =================================================================== File name: import data from AZK file.SPS Written by: Bruce Weaver, bweaver@lakeheadu.ca Date: 05-Apr-2005 Notes: Import data from .AZK file created by DMDX. * =================================================================== . * Define macro that gives path to the folder holding the .AZK file. define !data ()"C:\Program Files\DMDX\samples\"!enddefine. * Import data from .AZK file created by DMDX . * Read each row as a long string. GET DATA /TYPE = TXT /FILE = !data + 'single word visual lexical decision v2.azk' /FIXCASE = 1 /ARRANGEMENT = FIXED /FIRSTCASE = 1 /IMPORTCASE = ALL /VARIABLES = /1 V1 0-79 A80 . CACHE. EXECUTE. * Get rid of the first 3 rows, and rows of asterisks. compute keep = ($casenum GT 3) and (index(v1,'*********') = 0). exe. select if keep. exe. * Trim leading characters from V1, then extract needed info. compute v1 = LTRIM(v1). compute commapos = index(v1,','). compute idnum = number(substr(v1,8,commapos-8),f5). if missing(idnum) idnum = lag(idnum). compute datepos = index(v1,'/') - 2. do if (datepos > 0). - compute timepos = datepos + 11. - compute date = number(substr(v1,datepos,10),date11). end if. if missing(date) date = lag(date). compute #hh = number(substr(v1,timepos,2),f5). compute #mm = number(substr(v1,timepos+3,2),f5). compute #ss = number(substr(v1,timepos+6,2),f5). compute time = time.hms(#hh,#mm,#ss). if missing(time) time = lag(time). COMPUTE item = NUMBER(SUBSTR(V1,1,2),f5) . if missing(lag(item)) and not missing(item) order = 1. if missing(order) and not missing(item) order = lag(order) + 1. compute blankpos = index(v1,' '). if not missing(item) #rt = number(substr(v1,blankpos),f8). compute rt = abs(#rt). compute correct = (#rt > 0). exe. var width date time (11). format idnum item order (f5.0) / correct (f1.0) / rt (f5.0) / date (date11) / time (time10). * Keep original line of subject info, in case it is needed further. string rawinfo (a80). do if (datepos GT 0). - compute rawinfo = v1. else. - compute rawinfo = lag(rawinfo). end if. exe. * Keep only records with valid value for ITEM. select if not missing(item). exe. sort cases by idnum item. save outfile = !data + 'single word visual lexical decision v2.sav' /keep = idnum date time item order correct rt rawinfo /compressed. * If mean or median RTs are desired, these can be obtained * by opening the file that was just saved, and using the * AGGREGATE procedure. Ditto for percent correct. * End of job. * =================================================================== .