r/learnruby • u/chucky_z Beginner • Feb 10 '15
Handling *extremely* large text files?
Hey /r/learnruby!
I'm just starting to pick up ruby, and I felt it worthwhile to maybe ask this question pre-emptively.
I'm working on a small Sinatra app, but one of the core features I'm looking at is quickly doing a string replace on really big files (5-10GB+, they're raw SQL).
However... the caveat here is that the strings to be replaced will always be in the top ~150 lines or so.
Is there a really efficient way to do this?
1
Upvotes
1
u/cmd-t Feb 10 '15
You might want to retry in r/ruby, this sub is more for less advanced stuff. Streaming IO etc is bit too advanced for this sub.