Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_log needs trim_ws argument #738

Closed
jaearick opened this issue Nov 4, 2017 · 0 comments
Closed

read_log needs trim_ws argument #738

jaearick opened this issue Nov 4, 2017 · 0 comments
Labels
feature a feature request or enhancement

Comments

@jaearick
Copy link

jaearick commented Nov 4, 2017

read_log() would benefit from the trim_ws argument available in read_delim(). Logfiles with single digit dates generate an empty column due to the fact that the date in the logfile is given as "Nov[space][space]4" instead of "Nov[space]4". Example:

library(readr)
logfile <- read_log("logfile",col_types=cols(.default="c"),col_names=FALSE,progress=FALSE)

with data:

Nov  4 00:00:55 vrpweb1 httpd: 131.161.8.219 - - [04/Nov/2017:00:00:55 -0400] "GET /wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1 HTTP/1.1" 200 10056 "http://www.colby.edu/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"
Nov  4 00:00:55 vrpweb1 httpd: 131.161.8.216 - - [04/Nov/2017:00:00:55 -0400] "GET /wp-content/plugins/wooslider-AxZp6o/assets/js/jquery.flexslider.min.js?ver=2.4.1-20170608 HTTP/1.1" 200 22414 "http://www.colby.edu/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36"

will generate an empty column "X2". The trim_ws argument would remove this extra whitespace.

@jimhester jimhester added the feature a feature request or enhancement label Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants