[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: [PROGRAMMERING] Udfordring med awk og regulær udtryk



On Sat, 15 Jan 2011 23:56:46 +0100
Frank Damgaard <sslug@sslug> wrote:

> Den 15-01-2011 13:03, Jesper K. Pedersen skrev:
>  ......
> 
> > awk '{ match($0, /(.*)\<([[:alnum:]_-]+)$/, arr); sub("[ \t]+$","",
> > arr[1]); print "insert into imdb_genres values
> > (\x27"arr[1]"\x27,\x27"arr[2]"\x27);"}'
> > 
> > 
> > Mit awk program ser ud som ovenstående.
> > 
> > Desværre render jeg ind i at den deler genren i genren hvis der er
> > "-" i genren - som "Sci-Fi".
> > 
> > 
> > Jeg havde forventet at \<[[:alnum:]_-]+$ ville match al tekst fra en
> > orddelin incl "-" indtil slutningen af linien. Men det virker ikke.
> 
> det er vist den \<  (empty string) match beginning af WORD der
> driller?
> 
> kan
>  match($0, /(.*)[[:space:]]+([[:alnum:]_-]+)$/, arr)
> ikke gøre det?
> hvis du ved der er et eller flere blanktegn inden genre.
> 

Det var lige præcis den ændring der skulle til.
Tak for hjælpen.

Mvh
JesperKP


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-02-01, 02:01 CET [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] *