Re: [R] Unable to read csv files with comma in values

2019-04-11 Thread Amit Govil
ot;) >>> >>> wh <- grep("\\[.+\\]",txt) ## which records need to be modified? >>> fixup <- gsub(" *, *","-",sub(".+(\\[.+\\]).+","\\1",txt[wh])) ## >>> bracketed expressions, changing "," to &quo

[R] Unable to read csv files with comma in values

2019-04-07 Thread Amit Govil
Hi, I have a bunch of csv files to read in R. I'm unable to read them correctly because in some of the files, there is a column ("Role") which has comma in the values. Sample data: User, Role, Rule, GAPId Sam, [HadoopAnalyst, DBA, Developer], R46443 I'm trying to play with the below code but it

[R] Need some help with data-wrangling in R

2018-08-24 Thread Amit Govil
Hi, I have log data in which one of the columns have IP ranges and the next column is corresponding ports. Eg: IPRange Port 10.78.64.0-10.78.66.255 D, A, C I need to expand the IPRange column into a list of network blocks till 3rd octet: IPRange IP Port 192.100.176.0-192.100.179.255 192.100.17