[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: File contents



"Craig" <craigsc@zdata.co.za> writes:

> Could someone help with changing file contents in a specific
> directory with a number of files.
>
> I used greg to extract the criteria but need something to change it.

Greg should feel a bit abused... Poor guy. 

Or did you mean the program?

 greg - A tool testing framework.

Scary... ;-)

In addition to the other solutions mentioned in this list you can use
rpl:

 rpl is a UN*X text replacement utility. It will replace strings with
 new strings in multiple text files. It can work recursively over
 directories and supports limiting the search to specific file
 suffixes.

It's syntax is as simple as "rpl oldstring newstring *" but there are
some advanced options available.


Or you can use "replace" from mysql-server (OK, it is overkill to
install mysql just for getting this tool but maybe you use it anyway).

>From the man page:

       replace - A utility program that is used by msql2mysql, but
       that has more general applicability as well. replace changes
       strings in place in files or on the standard input. Uses a
       finite state machine to match longer strings first. Can be used
       to swap strings.

[x] ulf

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!


-- 
To UNSUBSCRIBE, email to debian-isp-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: