[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: [PERL] DATETIME fra perl



On 9 Mar 2000, Kristian Bjørnskov wrote:

> Ja, men som jeg ser det løser den ikke rigtigt problemet. Så vil jeg
> vel stadig skulle lave en MONTH{'Jan'}=0;MONTH{'Feb'}=1 etc. Eller der
> der noget jeg har overset? - Ole, kan det laves om en one liner? :)

Mja. Det er ikke så kønt:

perl -ne
'sslug@sslug,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}=(1..12)}
/\S+\s+(\S+)\s+(\d+)\s+(\S+)\s+(\d+)/;
printf("%d-%02d-%02d %s\n",$4,$m{$1},$2,$3)' logfil

Eller:

perl -pe
'sslug@sslug,Feb,Mar,Apr,MayJun,Jul,Aug,Sep,Oct,Nov,Dec}=("01"..12),
@d{1..31}=("01"..31)}
s/\S+\s+(\S+)\s+(\d+)\s+(\S+)\s+(\d+)/$4-$m{$1}-$d{$2} $3/'


/Ole
--
Livet er for kort til fsck  --  reiserfs



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:52 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] *