[code:9z854kjm]
options validvarname=any;
data temp;
infile 'pathto\log.txt' end=eof;
retain re;
if _n_=1 then
re = prxparse('/^\d\d\d\d-\d\d-\d\d$/');
input @1 type $;
if type='#Fields:' then do;
input @1 datestr:$10. @;
do until(eof or not prxmatch(re, datestr));
date = input(datestr, yymmdd10.);
input time:time8.
's-sitename'n:$15.
's-ip'n:$15.
'cs-method'n:$10.
'cs-uri-stem'n:$255.
'cs-uri-query'n:$10.
's-port'n:$5.
'cs-username'n:$20.
'c-ip'n:$15.
'cs(User-Agent)'n:$255.
'sc-status'n:3.
'sc-substatus'n:1.
'sc-win32-status'n:1.
;
output;
if not eof then input @1 datestr:$10. @;
end;
end;
format date yymmdd10. time time8.;
drop type datestr;
run;
[/code:9z854kjm]
其实您最好手工做,经济危机的根本在生产力过剩。
我的意思是说,您最好把每段数据都拷贝到另一个文本文件里,然后再用那IMPORT WIZARD。这样比较稳妥。