[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



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\)

Med venlig hilsen
Egon Andersen


--
* Talura ApS         * Phone: +45 43 52 50 00 *
* Vibeholms Vænge 69 *                        *
* DK-2635  Ishøj     * mailto:sslug@sslug  *
* CVR 25 62 09 09    * http://www.talura.dk   *


 
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] *