> On Jan 27, 2018, at 12:58 AM, tomas wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Fri, Jan 26, 2018 at 03:31:37PM -0800, David Christensen wrote:
>
> [...]
>
>> I've "cleaned up" more files than I care to remember. (Perl s/// is the
>> road to madness for anything but
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, Jan 26, 2018 at 03:31:37PM -0800, David Christensen wrote:
[...]
> I've "cleaned up" more files than I care to remember. (Perl s/// is the
> road to madness for anything but the most trivial cases.) I wanted to give
> the OP an idea of w
David Christensen wrote:
> Yes -- I'm such an insensitive ass. ;-)
>
nice to meet you :)
>
> I've "cleaned up" more files than I care to remember. Lexing, parsing,
> and EBFN are the standard computer science tools for tasks such as this.
> (Perl s/// is the road to madness for anything but
te:
>
> The file is ugly, with lots of extraneous characters--I want to run a series
> of
> regular expression search and replace commands over the file to clean it up.
I've "cleaned up" more files than I care to remember. Lexing, parsing, and
EBFN are the standard
David Christensen wrote:
> I used to subscribe to Perl Beginners, but the administrator got draconian
> about discussing other languages, I dropped, and now I appear to be
> banned:
>
> https://lists.perl.org/list/beginners.html
>
>
>> I've never used Perl, but I'm hoping Perl can do the job fo
gt; data
> dump from a database--I have no control over the database or the format ofe
> dump.
>
> The file is ugly, with lots of extraneous characters--I want to run a series
> of
> regular expression search and replace commands over the file to clean it up.
>
> Some o
On Wednesday, January 24, 2018 03:21:19 PM to...@tuxteam.de wrote:
> On Wed, Jan 24, 2018 at 02:14:42PM -0500, rhkra...@gmail.com wrote:
> > This is OT, but I thought I'd start with this list as it is the list that
> > I deal with more than any other. If no one here can help, suggestions
> > for a
database or the format ofe
> dump.
Perl won't have a problem with a 5.4MB long line.
[...]
>* The file can, and often will have UTF-8 characters in it (iiuc--the file
> contains URLs, some of which, I'm sure, can include UTF-8 characters, or
> maybe
> some other en
I have multiple large files (one example is 5.4 MB). It is essentially a data
dump from a database--I have no control over the database or the format ofe
dump.
The file is ugly, with lots of extraneous characters--I want to run a series of
regular expression search and replace commands over the f
On 2006-05-05 @ 18:48:36 (week 18) H.S. wrote:
> Casey T. Deccio wrote:
>
> >
> > find . -name "*.html" | xargs sed -i.bak -e
> > 's/string_to_replace/replacement/g'
> >
> > Does something like this work? If your match pattern spans more than
> > one line than you'll need a more complex script
Casey T. Deccio wrote:
>
> find . -name "*.html" | xargs sed -i.bak -e
> 's/string_to_replace/replacement/g'
>
> Does something like this work? If your match pattern spans more than
> one line than you'll need a more complex script.
>
> Casey
>
>
>
For all cases so far, I haven't had any n
Casey T. Deccio wrote:
On Fri, 2006-05-05 at 13:16 -0400, H.S. wrote:
The problem is to change a particular link in all the pages. I assume
the webpages were made using a template. If I were to search and replace
a particular string with a the new desired one, I would be done. Could
somebody
On Fri, 2006-05-05 at 13:16 -0400, H.S. wrote:
> The problem is to change a particular link in all the pages. I assume
> the webpages were made using a template. If I were to search and replace
> a particular string with a the new desired one, I would be done. Could
> somebody suggest
and replace code in php or html files
Linas Žvirblis wrote:
>
> Check out "rpl" package.
>
I will take a look, thanks.
>
> See if it contains a "generator" meta tag. Other than that, sites made
> with Frontpage will contain all sorts of errors,
Linas Žvirblis wrote:
>
> Check out "rpl" package.
>
I will take a look, thanks.
>
> See if it contains a "generator" meta tag. Other than that, sites made
> with Frontpage will contain all sorts of errors, MS specific code etc.
> This is not a scientific definition, but if it looks like cra
H.S. wrote:
> The problem is to change a particular link in all the pages. I assume
> the webpages were made using a template. If I were to search and replace
> a particular string with a the new desired one, I would be done.
Check out "rpl" package.
> As an aside, given
particular link in all the pages. I assume
the webpages were made using a template. If I were to search and replace
a particular string with a the new desired one, I would be done. Could
somebody suggest the best way to use grep and sed to make these changes?
The main problems are matching HTML code
On Thu, 17 Jun 2004 08:46:38 +1000
Zenaan Harkness <[EMAIL PROTECTED]> wrote:
> What do people use for multi-file/ multi-directory search and replace?
>
> I use something like this:
>
> find . -name \*java|xargs perl -p -i.bak -e 's/searchRE/replaceRE/g;'
>
&
What do people use for multi-file/ multi-directory search and replace?
I use something like this:
find . -name \*java|xargs perl -p -i.bak -e 's/searchRE/replaceRE/g;'
However, I would also like to see which files actually got changed.
With the in-place option (-i[backup-extensio
On Thursday 28 Aug 2003 13:24, Al Davis wrote:
> On Thursday 28 August 2003 03:08 am, Alex Malinovich wrote:
> > As much as I hate to admit that MS can do some things right,
> > their 'ren' command (rename, instead of doing a mv from name
> > to name like we do) is actually quite intelligent.
>
> W
On Thursday 28 August 2003 03:08 am, Alex Malinovich wrote:
> As much as I hate to admit that MS can do some things right,
> their 'ren' command (rename, instead of doing a mv from name
> to name like we do) is actually quite intelligent.
Wasn't that part of QDOS?
--
To UNSUBSCRIBE, email to [E
On Thu, 2003-08-28 at 02:08, Alex Malinovich wrote:
> On Wed, 2003-08-27 at 18:15, Yves Goergen wrote:
[snip]
> As much as I hate to admit that MS can do some things right, their 'ren'
> command (rename, instead of doing a mv from name to name like we do) is
> actually quite intelligent. Not quite
On Wed, 2003-08-27 at 18:15, Yves Goergen wrote:
> right. i was wondering, not long ago, if there's a possibility to
> merge both parameters of the 'rename' shell script into one and port
> all this to, say, windows. there are many situations where such a tool
> would make my life a bit easier...
Von: "Harshwardhan Nagaonkar" <[EMAIL PROTECTED]>
> Hahaha. It always amuses me whenever we have a thread about a particular
> topic, which refrences a particular search-and-replace command. Various
> other people reply and give examples with which the said
> search-
about a particular
topic, which refrences a particular search-and-replace command. Various
other people reply and give examples with which the said
search-and-replace command will not work; and then give their own
versions of the command.
All that said, isn't there like a "One True Search-a
on Tue, Jan 09, 2001 at 08:30:59PM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Tue, Jan 09, 2001 at 11:29:31AM -0800, kmself@ix.netcom.com wrote:
> :on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
> PROTECTED]) wrote:
>
> :> find . -name *.txt -exec cp {} {}.tm
Jonathan D. Proulx wrote:
> also note that you must quote the wildcard '*.txt' to prevent shell
> expantion, but I feel the example stands bugs and all. Using xargs or
> for i in `find . -name '*.txt'` can result in stack overflows if there
> are alot of file (I don't know howmany, but it happened
On Tue, Jan 09, 2001 at 11:29:31AM -0800, kmself@ix.netcom.com wrote:
:on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
:> find . -name *.txt -exec cp {} {}.tmp \; -exec sed s/foo/boo/g {} \;
:>
:> or writing a small shell/perl/sed/awk/whatever script that
on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Mon, Jan 08, 2001 at 11:52:26PM -0800, kmself@ix.netcom.com wrote:
>
> :> My vote for most elegant:
> :>
> :> find . -name *.txt -exec sed s/foo/boo/g {} \;
> :> {} refers to file found
1 at 02:33:34PM +0100, [EMAIL PROTECTED] wrote:
> csj schrieb:
> > On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > > Is there a tool to do a search-and-replace from the command line?
> > > Something along the lines of:
> > >
> > > replace "
csj schrieb:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Something along the lines of:
> >
> > replace "string one" "string foo" files-to-process
>
>
On Mon, Jan 08, 2001 at 11:52:26PM -0800, kmself@ix.netcom.com wrote:
:> My vote for most elegant:
:>
:> find . -name *.txt -exec sed s/foo/boo/g {} \;
:> {} refers to file found ^ ^must have \; to terminate
:> -exec
:
:This solution doe
on Mon, Jan 08, 2001 at 05:53:51PM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Tue, Jan 09, 2001 at 12:54:34AM +0800, csj wrote:
>
> :for i in *.txt ; do mv $i $i.tmp ; sed s/foo/boo/g $i.tmp > $i ; done
> :
> :Can anybody comment on this little script? This appears to work, but
>
On Tue, Jan 09, 2001 at 12:54:34AM +0800, csj wrote:
:for i in *.txt ; do mv $i $i.tmp ; sed s/foo/boo/g $i.tmp > $i ; done
:
:Can anybody comment on this little script? This appears to work, but
:may be inefficient. And it's one step removed from what I want,
:recursive processing. That is, to
then do this:
for i in `find . -name *.txt` ; do blah ; done
and make sure you know what you're doing.
cheers, robt
csj wrote:
>
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Somet
On Tue, 9 Jan 2001 00:54:34 +0800
csj <[EMAIL PROTECTED]> wrote:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Something along the lines of:
> >
> > replace "string one" &
On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
sed is it! Thanks to John <[EMAIL PROTECTED]>, Mich
csj wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
>
> I find it a bit of a hassle to keep 100+ files open just to change an
> ".htm
on Mon, Jan 08, 2001 at 01:42:08AM +0800, eechi von akusyumi ([EMAIL
PROTECTED]) wrote:
> suggestion:
>
> cat file | sed s/search/replace/gi >file2;cp file2 file1;
Note that this solution creates an additional process for each file
handled. The more elegant solution is:
$ sed -e '/search/s
On Sun, Jan 07, 2001 at 06:12:54PM +0100, Michal F. Hanula wrote:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, csj wrote:
> > Is there a tool to do a search-and-replace from the command
> > line? Something along the lines of:
> >
> > replace "string one" &q
suggestion:
cat file | sed s/search/replace/gi >file2;cp file2 file1;
- Original Message -
From: "John Hasler" <[EMAIL PROTECTED]>
To:
Sent: Monday, January 08, 2001 1:29 AM
Subject: Re: Command line search and replace
> csj writes:
> > Is there a tool to
csj writes:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
> replace "string one" "string foo" files-to-process
Look at awk and sed.
--
John Hasler
[EMAIL PROTECTED]
Dancing Horse Hill
Elmwood, Wisconsin
On Mon, Jan 08, 2001 at 12:56:45AM +0800, csj wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
>
> I find it a bit of a hassle to keep 100+ file
Is there a tool to do a search-and-replace from the command line?
Something along the lines of:
replace "string one" "string foo" files-to-process
I find it a bit of a hassle to keep 100+ files open just to change an
".html" to an ".htm." Note however
perl is designed for this kind of thing.
use it carefully, though--AFTER you back everything up!
#!/usr/bin/perl
use File::Find;
see 'man File::Find' (or perldoc 'File::Find') for the
full poop.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Their is five errers in this sentance.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
Jaume Teixi <[EMAIL PROTECTED]> writes:
> Howto search and replace for a pattern over all system files ?
>
> It's faster with vi, ed ?
sed. And a bit of shell script. For instance (off the top of my head,
so no gu
> Howto search and replace for a pattern over all system files ?
>
try a perl-expression.
find / '!' -type d -exec perl -e "s/foo/bar/baz" '{}' ';'
this is definitely not ready-to-run, but it's a good point to start
from. look at the perl man p
Howto search and replace for a pattern over all system files ?
It's faster with vi, ed ?
John Greer hat gesagt: // John Greer wrote:
> I know that this is not Debian specific but I thought I would give it a
> shot anyway. I need to search a series of files for a text string
> (grep I know) and then I need to replace that string with another. Is
> there a command or string of comm
[EMAIL PROTECTED] (shaul) writes:
> Are there www sites from where I can download introductory level texts for
> these tools ?
awk: info gawk (Install gawk package first)
sed: man sed, under "SEE ALSO"
Perl: http://language.perl.com/
Python: http://www.python.org/ or /usr/doc/python/html/tut/in
> sed was made for that. there are lots of other tools
> that are more programming-oriented (awk, perl, python...);
> sed is simple and a bit cryptic but good to get to know.
>
Are there www sites from where I can download introductory level texts for
these tools ?
Hi,
Yes there are quite a few ways to do that, another example:
GLOBAL REPLACE in the files:
awk '{gsub("call", "mall", $0); print > FILENAME}' *.kumac
change call to mall in all *.kumac files
Word of CAUTION: If you process really big files you may run into trouble,
that only part of your file
sed was made for that. there are lots of other tools
that are more programming-oriented (awk, perl, python...);
sed is simple and a bit cryptic but good to get to know.
John Greer wrote:
>
> I know that this is not Debian specific but I thought I would give it a
> shot anyway. I need to searc
On Fri, Jan 08, 1999 at 08:49:10AM -0700, John Greer wrote:
> I know that this is not Debian specific but I thought I would give it a
> shot anyway. I need to search a series of files for a text string
> (grep I know) and then I need to replace that string with another. Is
> there a command or
I know that this is not Debian specific but I thought I would give it a
shot anyway. I need to search a series of files for a text string
(grep I know) and then I need to replace that string with another. Is
there a command or string of commands that I can do this in? If
this is possible it
> This is especially nifty because "from" may be a perl regular expression
> (including parentheses pairs enclosing substrings of itself) and "to"
> may include $1, $2... refernces to such pairs- very handy.
Well, not with the example I gave you can't, but if you use something like
this, you can u
When Joey Hess wrote, I replied:
This is especially nifty because "from" may be a perl regular expression
(including parentheses pairs enclosing substrings of itself) and "to"
may include $1, $2... refernces to such pairs- very handy.
>
> > Was just wondering if there is a package out that does m
On Wed, 8 Jan 1997, Chad Zimmerman wrote:
> Was just wondering if there is a package out that does multiple file
> search and replaces? I have to go through my main html directory and
> make a lot of repetive changes. Was wondering if there was a package
> or a perl script laying arround to do th
> Was just wondering if there is a package out that does multiple file
> search and replaces? I have to go through my main html directory and make
> a lot of repetive changes. Was wondering if there was a package or a perl
> script laying arround to do this. Would same me the time of writing one
> From: Chad Zimmerman <[EMAIL PROTECTED]>
> Was just wondering if there is a package out that does multiple file
> search and replaces? I have to go through my main html directory and make
> a lot of repetive changes. Was wondering if there was a package or a perl
> script laying arround to do
On Wed, 8 Jan 1997, Rick Macdonald wrote:
> Chad Zimmerman wrote:
> >
> > Was just wondering if there is a package out that does multiple file
> > search and replaces? I have to go through my main html directory and make
> > a lot of repetive changes. Was wondering if there was a package or a p
-BEGIN PGP SIGNED MESSAGE-
On Wed, 8 Jan 1997, Chad Zimmerman wrote:
>
> Was just wondering if there is a package out that does multiple file
> search and replaces? I have to go through my main html directory and make
> a lot of repetive changes. Was wondering if there was a package or
Chad Zimmerman ([EMAIL PROTECTED]) wrote:
: Was just wondering if there is a package out that does multiple file
: search and replaces? I have to go through my main html directory and make
: a lot of repetive changes. Was wondering if there was a package or a perl
: script laying arround to do th
Chad Zimmerman wrote:
>
> Was just wondering if there is a package out that does multiple file
> search and replaces? I have to go through my main html directory and make
> a lot of repetive changes. Was wondering if there was a package or a perl
> script laying arround to do this. Would same m
Was just wondering if there is a package out that does multiple file
search and replaces? I have to go through my main html directory and make
a lot of repetive changes. Was wondering if there was a package or a perl
script laying arround to do this. Would same me the time of writing one
up.
C
65 matches
Mail list logo