> 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
-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
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
ail.com wrote:
>
> 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 computer
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
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 of the things th
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
e 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 encoding??). The search an
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 file to clean
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.
Might I
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 the best way to use grep and sed to make these changes?
The main problems are matching HTML code
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 the webpage, is there anyway
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 crap, it most
It was generated by dreamweaver then - Dreamweaver prefixes the javascript
functions it creates for rollover images with mm
Regards,
Pat
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of H.S.
Sent: 05 May 2006 18:45
To: debian-user@lists.debian.org
Subject: Re: search
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 the best way
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
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 need to
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-extension]), every
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;'
However, I would also like to see which
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-and-replace command will not work
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...
As
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 to
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
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.
Wasn't
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-and-replace Command
which will handle all
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 to
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 {} {}.tmp \;
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
:may
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 doesn't
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
sed is it! Thanks to John [EMAIL PROTECTED], Michal
[EMAIL PROTECTED], und
: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 string one string foo files-to-process
sed is it! Thanks to John [EMAIL
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 ^ ^must
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 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 string foo files-to-process
I find it a bit
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
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
.html to an .htm. Note however that I intend to use the tool
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], Michal
[EMAIL PROTECTED], und eechi von akusyumi
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 string foo files-to-process
sed is it! Thanks to John
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?
Something along the lines of:
replace
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
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 that I intend to use the tool on
other text files
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+ files open just to change an
.html to an .htm
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
suggestion:
cat file | sed s/search/replace/gi file2;cp file2 file1;
- Original Message -
From: John Hasler [EMAIL PROTECTED]
To: debian-user@lists.debian.org
Sent: Monday, January 08, 2001 1:29 AM
Subject: Re: Command line search and replace
csj writes:
Is there a tool to do
Howto search and replace for a pattern over all system files ?
It's faster with vi, ed ?
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 page.
--
Hi! I'm a .signature virus! Copy me
-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 guarantees):
for i in $file_list
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.
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
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 ?
[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
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
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
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 search
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
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
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 use all
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 me
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
-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 a
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 perl
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 this.
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
this. Would same me the time of
writing one up.
sounds like a job for an ed script embedded within a sh script :-)
something like:
--cut here-
#! /bin/sh
for i in *.html ; do
cat __EOF__ | ed -s $i
s/SEARCH/REPLACE/g
(and/or any other ed commands you might need here. just about anything
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.
65 matches
Mail list logo