Re: Re: need help with sed problem

2011-03-19 Thread Clive Standbridge
i agree with that - the underscore that was used is also valid. you might look at proper quoting of variables to avoid this. something like cat text.txt | sed -e 's/bbb.*/:$PWD/' new.txt The output from that, given Joao's original text.txt, is :$PWD The reason is that

need help with sed problem

2011-03-18 Thread Joao Ferreira gmail
Hello all I need to use sed to replace a given line in a text file with the current working directory. But this is getting quite tricky. Problem ilustrated below: $ cat text.txt :/some/wrong/path/ $ sed s/.*/:$TERM/ text.txt

Re: need help with sed problem

2011-03-18 Thread Andrej Kacian
On Fri, 18 Mar 2011 17:46:04 + Joao Ferreira gmail joao.miguel.c.ferre...@gmail.com wrote: jmf@squeeje:~$ sed s/.*/:$PWD/ text.txt sed: -e expression #1, char 16: unknown option to `s' Hello, this is because $PWD gets expanded by shell before sed gets called, so what actually gets

Re: need help with sed problem

2011-03-18 Thread Boyd Stephen Smith Jr.
On 2011-03-18 12:59:08 Andrej Kacian wrote: To get result you want, try using different separator character than /, for example the comma, or underscore: Colon is also a pretty good choice. While it is allowed in pathnames, it already causes problems. Try adding a directory containing colon to

Re: need help with sed problem

2011-03-18 Thread Joao Ferreira gmail
On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: On Fri, 18 Mar 2011 17:46:04 + Joao Ferreira gmail joao.miguel.c.ferre...@gmail.com wrote: jmf@squeeje:~$ sed s/.*/:$PWD/ text.txt sed: -e expression #1, char 16: unknown option to `s' Hello, this is because $PWD gets

Re: need help with sed problem

2011-03-18 Thread Dr. Ed Morbius
on 19:08 Fri 18 Mar, Joao Ferreira gmail (joao.miguel.c.ferre...@gmail.com) wrote: On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: On Fri, 18 Mar 2011 17:46:04 + Joao Ferreira gmail joao.miguel.c.ferre...@gmail.com wrote: jmf@squeeje:~$ sed s/.*/:$PWD/ text.txt

Re: need help with sed problem

2011-03-18 Thread shawn wilson
On Fri, Mar 18, 2011 at 7:05 PM, Dr. Ed Morbius dredmorb...@gmail.comwrote: on 19:08 Fri 18 Mar, Joao Ferreira gmail (joao.miguel.c.ferre...@gmail.com) wrote: On Fri, 2011-03-18 at 18:59 +0100, Andrej Kacian wrote: On Fri, 18 Mar 2011 17:46:04 + Joao Ferreira gmail

find -execdir + sed problem

2009-01-08 Thread Micha Feigin
I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running find . -name *.JPG.jpg -execdir echo `echo '{}' | sed -e 's/\(.*\).JPG.jpg/\1.jpg/' -` \; on a directory with

Re: find -execdir + sed problem

2009-01-08 Thread Sven Joachim
On 2009-01-08 11:03 +0100, Micha Feigin wrote: I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running find . -name *.JPG.jpg -execdir echo `echo '{}' | sed -e

Re: find -execdir + sed problem

2009-01-08 Thread Bob Cox
On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: find . -type f -exec echo `echo '{}' | tr [:upper:] [:lower:]` \; also fails to convert the file to lower case for some reason (same problem, doesn't change the case, as if it doesn't see the characters).

Re: find -execdir + sed problem

2009-01-08 Thread Bob Cox
On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running find . -name *.JPG.jpg -execdir echo `echo

Re: find -execdir + sed problem

2009-01-08 Thread Rainer Kluge
Bob Cox schrieb: On Thu, Jan 08, 2009 at 12:03:38 +0200, Micha Feigin (mi...@post.tau.ac.il) wrote: find . -type f -exec echo `echo '{}' | tr [:upper:] [:lower:]` \; also fails to convert the file to lower case for some reason (same problem, doesn't change the case, as if it doesn't see the

Re: find -execdir + sed problem

2009-01-08 Thread Micha Feigin
On Thu, 08 Jan 2009 11:24:27 +0100 Sven Joachim svenj...@gmx.de wrote: On 2009-01-08 11:03 +0100, Micha Feigin wrote: I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running

Re: find -execdir + sed problem

2009-01-08 Thread Alex Samad
On Thu, Jan 08, 2009 at 12:03:38PM +0200, Micha Feigin wrote: I'm trying to fix the file suffix on some file in my directories using sed and find but for some reason sed doesn't match the string in this manner, that is running find . -name *.JPG.jpg -execdir echo `echo '{}' | sed -e

Re: sed Problem die 2.

2005-09-07 Thread Moritz Karbach
Hi, Ich muß eine Nummer aus folgendem String extrahieren: wenn du viele solche Sachen machen musst, lohnt sich für dich vielleicht ein Blick auf Perl! zB: --- extract.pl --- #!/usr/bin/perl while() { if ( m/\(([\d\/\-]+)\)/ ) { print $1; print

Re: sed Problem die 2.

2005-09-07 Thread Sven Gehr
Am Mi 07.09.2005 11:38 schrieb Moritz Karbach [EMAIL PROTECTED]: Hallo, Ich muß eine Nummer aus folgendem String extrahieren: wenn du viele solche Sachen machen musst, lohnt sich für dich vielleicht ein Blick auf Perl! --- extract.pl --- #!/usr/bin/perl while() { if ( m/(([d/-]+))/ )

sed Problem die 2.

2005-09-06 Thread Sven Gehr
Hallo zusammen, nachdem ihr mir beim letzten sed-Problem geholfen habt und alles soweit funktioniert habe ich nun ein weiteres das ich mit dem Wissen des 1. leider nicht alleine hin bekomme. Ich weiß nicht ob es mit sed überhaubt funktioniert. Ich muß eine Nummer aus folgendem String extrahieren

Re: sed Problem die 2.

2005-09-06 Thread Juergen Salk
* Sven Gehr [EMAIL PROTECTED] [050906 09:56]: Ich muß eine Nummer aus folgendem String extrahieren: 381 470 M (@#  )[92 50 25  0]xS 573 470 M (0621/48293-91)[50 50 50 50 28 50 50 50 50 50 33 50  0]xS 1184 470 M ( #@)[25 50  0]xS Die Nummer die ich daraus brauche ist die

Re: sed - Problem

2005-09-01 Thread Sven Gehr
Am Mi 31.08.2005 15:27 schrieb Frank Küster [EMAIL PROTECTED]: Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 12:55:18, schrieb Sven Gehr: Hallo zusammen, bin auf ein weiteres Problem mit meinem Skript (sed) gestoßen welches absolut komisch ist, zumindest für mich. Ausgangsmaterial

Re: sed - Problem

2005-09-01 Thread Michelle Konzack
Am 2005-09-01 10:03:02, schrieb Sven Gehr: also alles perfekt. Nun muß ich die zwei Schritte zu einem zusammenfassen und habe folgendes Skript erstellt: #!/bin/sh PS2ASCII=/usr/bin/ps2ascii FAXFILE=/usr/lib/cups/backend/out.ps FAXNUM=`($PS2ASCII $FAXFILE)|sed -e 's/[EMAIL PROTECTED]//' -e

Re: sed - Problem

2005-09-01 Thread Sven Gehr
Am Do 01.09.2005 11:06 schrieb Michelle Konzack [EMAIL PROTECTED]: Am 2005-09-01 10:03:02, schrieb Sven Gehr: also alles perfekt. Nun muß ich die zwei Schritte zu einem zusammenfassen und habe folgendes Skript erstellt: #!/bin/sh PS2ASCII=/usr/bin/ps2ascii

Re: sed - Problem

2005-09-01 Thread David Haller
Hallo, Am Thu, 01 Sep 2005, Sven Gehr schrieb: Am Mi 31.08.2005 15:27 schrieb Frank Küster [EMAIL PROTECTED]: Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 12:55:18, schrieb Sven Gehr: [..] also alles perfekt. Nun muß ich die zwei Schritte zu einem zusammenfassen und habe folgendes

sed - Problem

2005-08-31 Thread Sven Gehr
Hallo zusammen, ich habe ein Problem mit sed. Die Problemstellung ist wie folgt: In einem Textfile stehen an einer nicht exakt definierten Position ein String der mit @@ beginnt und mit @@ endet. Der Teil der zwischen diesen @@'s steht soll extrahiert werden und unformatiert werden. Beim

Re: sed - Problem

2005-08-31 Thread Frank Küster
Sven Gehr [EMAIL PROTECTED] wrote: 2.) Nachdem ein evtl. vorhandenes + Zeichen am Anfang umgesetzt ist sollen alle Zeichen die keine Zahl sind (Leerzeichen, /, - etc.) entfernt werden. Ich bin nicht unbedingt der sed-Profi. Was ich bisher hinbekommen habe ist: sed -r

Re: sed - Problem

2005-08-31 Thread Christian Frommeyer
Am Mittwoch 31 August 2005 09:41 schrieb Sven Gehr: [sed-Wunsch] echo @@+49621 4829/399@@bla bla bla|sed . erhalte ich: 00496214829399bla bla bla Also wenn nichts gegen mehrere Ausdrücke spricht probier doch mal: 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' 's/\s*+/00/' 's/[^0-9]//g' also z.B.

Re: sed - Problem

2005-08-31 Thread Michelle Konzack
Am 2005-08-31 09:41:13, schrieb Sven Gehr: Hallo zusammen, ich habe ein Problem mit sed. Die Problemstellung ist wie folgt: blubber sed -r 's/@@\s*?\+([0-9]+)\s*?([0-9]+)[^0-9]*?([0-9]+)\/?([0-9]+)?@@/00\1\2\3\4/g' Mache ich ein: echo @@+49621 4829/399@@bla bla bla|sed . erhalte

Re: sed - Problem

2005-08-31 Thread Michelle Konzack
Am 2005-08-31 11:23:33, schrieb Christian Frommeyer: Also wenn nichts gegen mehrere Ausdrücke spricht probier doch mal: 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' 's/\s*+/00/' 's/[^0-9]//g' also z.B. mit sed -r -e 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' -e 's/\s*+/00/' -e 's/[^0-9]//g' Das

Re: sed - Problem

2005-08-31 Thread Mario 'BitKoenig' Holbe
Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 11:23:33, schrieb Christian Frommeyer: sed -r -e 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' -e 's/\s*+/00/' -e 's/[^0-9]//g' Das ist aber nicht gut... Besser: sed -r -e 's/.*@@([EMAIL PROTECTED])@@.*/\1/g;s/\s*+/00/;s/[^0-9]//g' Rein

Re: sed - Problem

2005-08-31 Thread Gebhard Dettmar
On Wednesday 31 August 2005 09:41, Sven Gehr wrote: Hallo zusammen, ich habe ein Problem mit sed. Die Problemstellung ist wie folgt: In einem Textfile stehen an einer nicht exakt definierten Position ein String der mit @@ beginnt und mit @@ endet. Der Teil der zwischen diesen @@'s steht

Re: sed - Problem

2005-08-31 Thread Michelle Konzack
Am 2005-08-31 11:52:03, schrieb Mario 'BitKoenig' Holbe: Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 11:23:33, schrieb Christian Frommeyer: sed -r -e 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' -e 's/\s*+/00/' -e 's/[^0-9]//g' Das ist aber nicht gut... Besser: sed -r -e

Re: sed - Problem

2005-08-31 Thread Sven Gehr
Am Mi 31.08.2005 11:26 schrieb Michelle Konzack [EMAIL PROTECTED]: Am 2005-08-31 09:41:13, schrieb Sven Gehr: Vielen Dank für die Vorschläge. In der zwischenzeit habe ich viel mit sed herum probiert und habe noch einiges geändert. Die Zeichen die den Anfang und das Ende markieren kann ich ja

Re: sed - Problem

2005-08-31 Thread Sven Gehr
Am Mi 31.08.2005 12:55 schrieb Sven Gehr [EMAIL PROTECTED]: Hallo, [...] Nun wollte ich das Ganze in ein Skript einbauen und habe so meine Probleme damit. #!/bin/sh FAXFILE=/usr/lib/cups/backend/doc155.txt FAXNUME=$FAXFILE|sed -e 's/[EMAIL PROTECTED]//' -e 's/[EMAIL PROTECTED]//' -e 's/

Re: sed - Problem

2005-08-31 Thread Michelle Konzack
Am 2005-08-31 12:55:18, schrieb Sven Gehr: Nun wollte ich das Ganze in ein Skript einbauen und habe so meine Probleme damit. #!/bin/sh FAXFILE=/usr/lib/cups/backend/doc155.txt FAXNUME=$FAXFILE|sed -e 's/[EMAIL PROTECTED]//' -e 's/[EMAIL PROTECTED]//' -e 's/ //g' -e 's/^+49/0/' -e

Re: sed - Problem

2005-08-31 Thread Andreas Pakulat
On 31.Aug 2005 - 14:18:00, Michelle Konzack wrote: Am 2005-08-31 12:55:18, schrieb Sven Gehr: Nun wollte ich das Ganze in ein Skript einbauen und habe so meine Probleme damit. #!/bin/sh FAXFILE=/usr/lib/cups/backend/doc155.txt FAXNUME=$FAXFILE|sed -e 's/[EMAIL PROTECTED]//' -e

Re: sed - Problem

2005-08-31 Thread Frank Küster
Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 12:55:18, schrieb Sven Gehr: Nun wollte ich das Ganze in ein Skript einbauen und habe so meine Probleme damit. #!/bin/sh FAXFILE=/usr/lib/cups/backend/doc155.txt FAXNUME=$FAXFILE|sed -e 's/[EMAIL PROTECTED]//' -e 's/[EMAIL

Re: sed - Problem

2005-08-31 Thread David Haller
Hallo, Am Wed, 31 Aug 2005, Michelle Konzack schrieb: Am 2005-08-31 11:52:03, schrieb Mario 'BitKoenig' Holbe: Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-08-31 11:23:33, schrieb Christian Frommeyer: sed -r -e 's/.*@@([EMAIL PROTECTED])@@.*/\1/g' -e 's/\s*+/00/' -e 's/[^0-9]//g'

Re: sed problem

2003-10-21 Thread Floris Bruynooghe
On Mon, Oct 20, 2003 at 10:09:47PM +0100, Dave selby wrote: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p' sed

Re: sed problem

2003-10-20 Thread Dave selby
Dave selby wrote: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p' But no go. I have tried various ways but to no avail.

sed problem

2003-10-19 Thread Dave selby
I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p' But no go. I have tried various ways but to no avail. Any ideas ? Dave

Re: sed problem

2003-10-19 Thread David Jardine
On Sun, Oct 19, 2003 at 11:37:44AM +0100, Dave selby wrote: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p'

Re: sed problem

2003-10-19 Thread Andre Kalus
On Sun, 19 Oct 2003 11:37:44 +0100, Dave selby wrote: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p' But no

Re: sed problem

2003-10-19 Thread Michael D Schleif
Dave selby [EMAIL PROTECTED] [2003:10:19:11:37:44+0100] scribed: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p'

Re: sed problem

2003-10-19 Thread Bijan Soleymani
On Sun, Oct 19, 2003 at 11:37:44AM +0100, Dave selby wrote: I need to get the contents of a HTML title tag put it in a string. ie titlespecialist cards/title I need the specialist cards in a variable $titlecontents I thought it would be easy with sed sed -n '/title/,/\/title/p'

OT: Makefile sed-Problem

2003-10-06 Thread Lukas Ruf
Dear all, although I know it isn't anything that directly refers to Debian, I dare to post since I have seen many similar questions. Please excuse! The Problem: from a friend, I receive text-files that have a lot of whitespace before the end of a line or even lines consisting of only

Re: OT: Makefile sed-Problem

2003-10-06 Thread Oliver Elphick
On Mon, 2003-10-06 at 12:31, Lukas Ruf wrote: Dear all, although I know it isn't anything that directly refers to Debian, I dare to post since I have seen many similar questions. Please excuse! It's not off topic for debian-user. The Problem: from a friend, I receive text-files that have

Re: OT: Makefile sed-Problem

2003-10-06 Thread Lukas Ruf
Oliver Elphick [EMAIL PROTECTED] [2003-10-06 14:09]: On Mon, 2003-10-06 at 12:31, Lukas Ruf wrote: You are trying to use a Perl regular expression with sed; that doesn't work. Although the sed manpage refers to perlre, sed does not seem to support Perl regular expressions. You should

Re: SED problem

2003-10-05 Thread Dave selby
Michael D Schleif wrote: Michael D Schleif [EMAIL PROTECTED] [2003:10:04:16:32:37-0500] scribed: Dave selby [EMAIL PROTECTED] [2003:10:04:19:25:32+0100] scribed: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the

Re: SED problem

2003-10-05 Thread Dave selby
Bijan Soleymani wrote: On Sat, Oct 04, 2003 at 07:25:32PM +0100, Dave selby wrote: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code

Further SED problem

2003-10-05 Thread Dave selby
Im may be trying to push SED to far, in which case perl has been suggested, but here is my problem ... For a series of html pages, I need to take the text from the title tag and insert it where there is a xx in the document, deleting the xx. Ie use a template, fill in the title let SED do the

SED problem

2003-10-04 Thread Dave selby
I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code between !-- lockon:a:1 -- and !-- lockoff -- Including the above comments. I have tried,

Re: SED problem

2003-10-04 Thread Bijan Soleymani
On Sat, Oct 04, 2003 at 07:25:32PM +0100, Dave selby wrote: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code between !--

Re: SED problem

2003-10-04 Thread Michael D Schleif
Dave selby [EMAIL PROTECTED] [2003:10:04:19:25:32+0100] scribed: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling with the sed code. I need to delete all the code between !--

Re: SED problem

2003-10-04 Thread Michael D Schleif
Michael D Schleif [EMAIL PROTECTED] [2003:10:04:16:32:37-0500] scribed: Dave selby [EMAIL PROTECTED] [2003:10:04:19:25:32+0100] scribed: I have multiple html files. I need to remove the same chunk of code from all of them. I have made a bash loop to feed the files to sed, but am struggling

Re: sed problem

2002-12-19 Thread Michelle Konzack
Hallo Andre, Am 21:46 2002-12-17 +0100 hat Andre Fischer geschrieben: hallöchen, ich glaub mein sed kann nicht mehr zählen :( ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht: echo test 12345 test | sed s/[0-9]\{5\}/PLZ/g und habe folgendes Ergebnis erwartet:

sed problem

2002-12-17 Thread Andre Fischer
hallöchen, ich glaub mein sed kann nicht mehr zählen :( ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht: echo test 12345 test | sed s/[0-9]\{5\}/PLZ/g und habe folgendes Ergebnis erwartet: test PLZ test leider kommt test 12345 test - was mach ich da falsch?

Re: sed problem

2002-12-17 Thread Wolfgang Erig
On Tue, Dec 17, 2002 at 09:46:30PM +0100, Andre Fischer wrote: ich glaub mein sed kann nicht mehr zählen :( ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht: echo test 12345 test | sed s/[0-9]\{5\}/PLZ/g wenn ich mich recht erinnere, kann sed nicht den

Re: sed problem

2002-12-17 Thread fisch
Am Dienstag, 17. Dezember 2002 22:08 schrieb Wolfgang Erig: On Tue, Dec 17, 2002 at 09:46:30PM +0100, Andre Fischer wrote: ich glaub mein sed kann nicht mehr zählen :( ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht: echo test 12345 test | sed

Re: sed problem

2002-12-17 Thread Harald Weidner
Hallo, Andre Fischer [EMAIL PROTECTED]: echo test 12345 test | sed s/[0-9]\{5\}/PLZ/g und habe folgendes Ergebnis erwartet: test PLZ test leider kommt test 12345 test - was mach ich da falsch? Deine Shell verschluckt die Backslashes. Probiere es mal mit echo test 12345 test | sed

Re: sed problem

2002-12-17 Thread Andreas Wodrich
Andreas Wodrich wrote: fisch wrote: Am Dienstag, 17. Dezember 2002 22:08 schrieb Wolfgang Erig: On Tue, Dec 17, 2002 at 09:46:30PM +0100, Andre Fischer wrote: ich glaub mein sed kann nicht mehr zählen :( ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht:

Re: sed problem

2002-12-17 Thread Andre Fischer
Am Dienstag, 17. Dezember 2002 22:50 schrieb [EMAIL PROTECTED]: Andre Fischer schrieb: ich möchte die Zahlenfolge 12345 durch PLZ ersetzen und habe folgenden Test gemacht: echo test 12345 test | sed s/[0-9]\{5\}/PLZ/g und habe folgendes Ergebnis erwartet: test PLZ test leider kommt test