# !/bin/sh id="$0" outfile="${id}.unl" errfile="${id}.err" tmpfile1="/tmp/${id}.$$" rm -f "${outfile}" rm -f "${errfile}" rm -f "${tmpfile1}" runisql < errfile next } if ( length(mobile) != 10 ) { print "skipping mobile [" mobile "] " $0 > errfile next } if ( gotmobile_arr[mobile] == 1 ) { print "skipping duplicate mobile [" mobile "] " $0 > errfile next } gotmobile_arr[mobile] = 1 if ( recordno == 0 ) recordno = 10000 else ++recordno # sidconf table #printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s| # %s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s| # %s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s| # %s|%s|%s|%s|%s|%s|%s|%s|%s|\n", # recordno, sid, sidmainttype, sdate, edate, # grid, directoryid, # serialnumber, # purchased, # manufacturer, model, # supplier, datatype, # carriercode, servicetype, # "", "", "", "", "", "", "", "", "", # "", "", "", "", "", "", "", "", "", # introaming,contractstart,contractfinish,"","","","","","", # "", "", "", "", "", "", "", "", "", # gprs,simnumber,imeinumber,dataplan,archivecomment,puk,"","","", # updated, # msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8, msg9) # mobconf view on sidconf table printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|\n", recordno, mobile, customid, sdate, edate, directoryid, grid, datatype, purchased, supplier, manufacturer, model, carriercode, servicetype, introaming, gprs, simnumber, imeinumber, puk, dataplan, contractstart, contractfinish, archivecomment, updated, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8, msg9) }' < "$tmpfile1" >${outfile} rm -f "$tmpfile1" runisql <