[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
 

Udfordring med awk og regulær udtryk



Jeg forsøger for øjeblikket at lægge data ind fra IMDB i en SQL
database, for at kunne bruge det sammen med (endnu) en film database
jeg har lavet.

Mine inddata ser sådan her ud :
100 miljoen kinderen (2005) (TV)                        Documentary
100 Million BC (2008) (V)                               Action
100 Million BC (2008) (V)                               Adventure
100 Million BC (2008) (V)                               Fantasy
100 Million BC (2008) (V)                               Sci-Fi
100 Millionen Karat - Die Diamanten-Dynastie Oppenheimer (2006) (TV)
Documentary 
100 minuta slave (2004)                                 Biography
100 minuta slave (2004)                                 Drama

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.


Nogen ideer om hvad jeg gør galt?

På forhånd tak
  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] *