Re: Converting Apache log string into map using delimiter

2014-11-11 Thread YaoPau
OK I got it working with: z.map(row = (row.map(element = element.split(=)(0)) zip row.map(element = element.split(=)(1))).toMap) But I'm guessing there is a more efficient way than to create two separate lists and then zip them together and then convert the result into a map. -- View this

Re: Converting Apache log string into map using delimiter

2014-11-11 Thread Sean Owen
I think it would be faster/more compact as: z.map(_.map { element = val tokens = element.split(=) (tokens(0), tokens(1)) }.toMap) (That's probably 95% right but I didn't compile or test it.) On Wed, Nov 12, 2014 at 12:18 AM, YaoPau jonrgr...@gmail.com wrote: OK I got it working