[R] reading web log file into R

Sebastian Kruk residuo.solow at gmail.com
Wed Sep 23 03:51:17 CEST 2009


If I have a web log file as follows:

#Software: Microsoft Internet Information Services 5.0
#Version: 1.0
#Date: 2007-12-03 13:50:17
#Fields: date time c-ip cs-username s-ip s-port cs-method cs-uri-stem
cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(User-Agent)
cs(Cookie) cs(Referer)
"2007-12-03 13:50:17 200.40.203.197 - 200.40.51.20 80 GET
/localidades/img/nada.gif - 200 328 447 0
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)
ASPSESSIONIDSQCBSQAB=JOLECDCCBFCKPOFLGDLHMENA
http://www.teatro.com/localidades/localidades.asp"
"2007-12-03 13:50:17 200.40.203.197 - 200.40.51.20 80 GET
/localidades/img/cargando.gif - 200 1150 451 0
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)
ASPSESSIONIDSQCBSQAB=JOLECDCCBFCKPOFLGDLHMENA
http://www.teatro.com/localidades/localidades.asp"
"2007-12-03 13:50:18 200.40.203.197 - 200.40.51.20 80 GET
/localidades/img/cerrar.png - 200 450 449 0
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322)

how can I turn it into a dataframe with 3 rows, and 16 columns named
date time c-ip cs-username s-ip s-port cs-method cs-uri-stem
cs-uri-query sc-status sc-bytes cs-bytes time-taken cs(User-Agent)
cs(Cookie) cs(Referer) skiping lines begining with #?

Thanks,

Sebastián.




More information about the R-help mailing list