[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [TEKNIK] sed regular expression driller mig



On 10/08/2012, at 12.46, Egon Andersen wrote:
> Jon Bendtsen wrote:
>> On 10/08/2012, at 12.21, Egon Andersen wrote:
>>> Hej SSLUG'er
>>> 
>>> Jeg har en stak filer, hvor der har indsneget sig en fejl.
>>> Fejlen er simpelthen at der er kommet en tekst med der skulle være blanktegn. Det der driller mig er blot, at teksten starter med:
>>> \(
>>> og slutter med
>>> \)
>>> 
>>> Altså en tekst som ligner følgende: \(den fejlagtige tekst\)
>> sslug@sslug:/home/jonbendtsen# echo "foertekst \(den fejlagtige tekst\) eftertekst" foertekst \(den fejlagtige tekst\) eftertekst
>> sslug@sslug:/home/jonbendtsen# echo "foertekst \(den fejlagtige tekst\) eftertekst" | sed -e "s/\\\(.*\\\)//"
>> foertekst  eftertekst
> 
> Problemet med denne løsning er at *alle tekster* der starter med \( og slutter med \) vil blive fjernet. Og desværre findes denne type tekster mange steder. Så det der skal fjernes er *een specifik tekst*. Og denne tekst består desværre af:
> \(den fejlagtige tekst\)

okay, hvor svært er det så at indsætte 
	den fejlagtige tekst
i stedet for .* i ovenstående sed udtryk?

Eller også så kan du helt glemme \( og \) ved at bruge dette sed udtryk
	"s/..den fejlagtige tekst..//"


JonB



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2012-09-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *