I am trying to parse some access logs with Ruby, the file itself is 363MB. I'm working in IRB and when I try to assign the text from the document to a variable data = logs.read
it begins returning all the text into the interpreter, which at 363MB is an issue.
How do I assign the contents of a file to a variable without returning the value back in the interpreter?
Start your irb as below :
irb --simple-prompt --noecho
--simple-prompt
is to get the IRB prompt as >>
--noecho
is to off the echo on IRBHere is an example:
C:\>irb --simple-prompt
>> x = 2
=> 2
>> exit
C:\>irb --simple-prompt --noecho
>> x = 2
>>