# Conducting Regular Expressions on a text file

**URL:** <https://rubytalk.org/t/conducting-regular-expressions-on-a-text-file/40250>\
**Category:** ruby-talk\
**Created:** [29 August 2007 18:10 UTC](https://rubytalk.org/t/conducting-regular-expressions-on-a-text-file/40250 "2007-08-29T18:10:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![W\_James](https://avatars.discourse-cdn.com/v4/letter/w/e274bd/32.png) [@W\_James](https://rubytalk.org/u/W_James)\
**Post date:** [29 August 2007 18:10 UTC](https://rubytalk.org/t/conducting-regular-expressions-on-a-text-file/40250/1 "2007-08-29T18:10:09Z")

</div>

I think that Ruby makes a temporary copy of the file.

> **···**
>
> On Aug 27, 8:53 pm, "Logan Capaldo" \<logancapa...@gmail.com\> wrote:
> 
> > Incidentily ruby has a shortcut for doing this:
> > 
> > ruby -inp -e 'gsub!(/placeholder/, "word")' /folder/template.txt
> > 
> > To handle those really big files where you simply cannot afford to  
> > have two copies simultaneously,
