On 05/14/2010 10:37 AM, Boyd Stephen Smith Jr. wrote:
> On Friday 14 May 2010 12:04:42 Merciadri Luca wrote:
>> I have many text files (actually .tex files) which contain some
>> sequence or regexp (it depends on the files) that I would like to
>> remove. Is there a commandline/GUI for doing this massive edit?
> 
> (sed -i -e "s/$regexp//" "$file") for a single file.  (GNU sed only.)
> 

If you're not comfortable with making the change in place (meaning
losing the original, in case you got something wrong in the script),
just add a "SUFFIX" to the -i option, as in '-i.bak', and sed will make
a backup copy, using the suffix as the extension appended to the file name.

> (find $dir -type f -exec sed -i -e "s/$regexp//" {} \;) for all files in a 
> directory.

-- 
Bob McGowan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4bed8f70.3050...@symantec.com

Reply via email to