Re: Last line issue

2008-01-26 Thread John W. Krahn
Andrej Kastrin wrote: John W. Krahn wrote: This should do what you want: #!/usr/bin/perl use warnings; use strict; my $FNI = shift; my $FNO = "$FNI.dat"; open my $OUT, '>', $FNO or die "Cannot open '$FNO' $!"; open my $IN, '<', $FNI or die "Cannot open '$FNI' $!"; my ( $id, $line ); while

Re: Looking for regex

2008-01-26 Thread Chas. Owens
As a side note, you may want to use the everything up to and including the hour if your file can cover a time period longer than 24 hours: #! /usr/bin/perl use strict; use warnings; my %seen; while (my $line = <>) { print $line unless $seen{substr $line, 0, 13}++; } -- To unsubscribe,

Re: Looking for regex

2008-01-26 Thread John Kufrovich
It worked! I'll have to digest what you did, this evening. It's been raining for over a week and the sun is finally out so, I have to take care of some yard work. Thanks again, Chas! T "Chas. Owens" <[EMAIL PROTECTED]> wrote: On Jan 26, 2008 1:13 PM, John Kufrovich wrote:

Re: Looking for regex

2008-01-26 Thread Gunnar Hjalmarsson
John Kufrovich wrote: Chas. Owens wrote: my %seen; while () { my ($hour, $temp) = / (..).*?,(.*?),/; print "temp was $temp at $hour\n" unless $seen{$hour}++; } __DATA__ 2007-01-23 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground v.1.13, 2007-01-23 00:06:00,43

Re: Looking for regex

2008-01-26 Thread Chas. Owens
On Jan 26, 2008 1:13 PM, John Kufrovich <[EMAIL PROTECTED]> wrote: > Chas, > Thanks for the help. I'm not expert but I think your code will output each > line. snip You don't have to be an expert to run the code and see what it does (it only prints out the hour and temp for the first instance of

Re: Looking for regex

2008-01-26 Thread John Kufrovich
Chas, Thanks for the help. I'm not expert but I think your code will output each line. The output I'm trying to achieve. --Output--. h:m:s 2007-01-23 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground v.1.13, 2007-01-23 01:11:00,42.9,34.8,30.13,Nort

Re: 答复: is there a way to read content from lnk on windows?

2008-01-26 Thread Rob Dixon
Tom Phoenix wrote: 2008/1/25 Chen Yue <[EMAIL PROTECTED]>: I fully understand this. So I wonder is there a way to get the path that the blabla.lnk points to? You'd think so; symbolic links have a simple implementation on Unix-like machines. Besides, Windows itself can figure it out. Unless Mi

Re: Last line issue

2008-01-26 Thread Andrej Kastrin
Dear Jonh, many, many thanks for your quick answer. I modified your script a bit: $line .= $_ if /Id|To|From/; print $OUT "$id\t$line\n" if m!/Note!; to: $line .= $_ if m!! .. m!!; print $OUT "$id\t$line\n" if m!!; but some problem still persists with the output: 001 001Tho

Re: Looking for regex

2008-01-26 Thread Chas. Owens
On Jan 26, 2008 11:29 AM, Jerald Sheets <[EMAIL PROTECTED]> wrote: > Note that on that particular kind of feed, you *can* have three digits > on occasion. > > How would you go about allowing for the third digit if and only if it > exists? > > I had the first regex, but I'm not sure where the allowa

Re: Looking for regex

2008-01-26 Thread Jerald Sheets
Note that on that particular kind of feed, you *can* have three digits on occasion. How would you go about allowing for the third digit if and only if it exists? I had the first regex, but I'm not sure where the allowance for the third digit would come in, or how to allow for a random ser

Re: Looking for regex

2008-01-26 Thread Chas. Owens
On Jan 26, 2008 9:38 AM, John Kufrovich <[EMAIL PROTECTED]> wrote: > Time,TemperatureF,DewpointF,PressureIn,WindDirection > 2007-01-23 > 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground v.1.13, snip > What I am trying to accomplish is pull the first temp for each hour. I >

Re: Looking for regex

2008-01-26 Thread Rodrick Brown
On Jan 26, 2008 9:38 AM, John Kufrovich <[EMAIL PROTECTED]> wrote: > Time,TemperatureF,DewpointF,PressureIn,WindDirection > 2007-01-23 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground > v.1.13, > 2007-01-23 > 00:06:00,43.2,34.8,30.14,North,354,11,11,72,0.00,,,0.00,Wunderground

Re: Looking for regex

2008-01-26 Thread Rodrick Brown
On Jan 26, 2008 9:38 AM, John Kufrovich <[EMAIL PROTECTED]> wrote: > Time,TemperatureF,DewpointF,PressureIn,WindDirection > 2007-01-23 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground > v.1.13, > 2007-01-23 > 00:06:00,43.2,34.8,30.14,North,354,11,11,72,0.00,,,0.00,Wunderground

Looking for regex

2008-01-26 Thread John Kufrovich
Time,TemperatureF,DewpointF,PressureIn,WindDirection 2007-01-23 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground v.1.13, 2007-01-23 00:06:00,43.2,34.8,30.14,North,354,11,11,72,0.00,,,0.00,Wunderground v.1.13, 2007-01-23 00:12:00,43.2,34.8,30.14,North,1,6,9,72,0.00,,,0.00,Wunde

Re: Last line issue

2008-01-26 Thread John W. Krahn
Andrej Kastrin wrote: Dear all, Hello, to pre-process my XML dataset in run simple Perl script on it, which extract Id identifier from XML data and paste the whole XML record to it. For example, the input data looks like: 001 Thomas Joana 002

Last line issue

2008-01-26 Thread Andrej Kastrin
Dear all, to pre-process my XML dataset in run simple Perl script on it, which extract Id identifier from XML data and paste the whole XML record to it. For example, the input data looks like: 001 Thomas Joana 002 John Paula

Re: Can't install CDB_File

2008-01-26 Thread oleber
On Jan 25, 8:22 pm, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Jan 25, 2008 12:46 PM, marcos rebelo <[EMAIL PROTECTED]> wrote:> Hy all > > > I'm using the last Ubuntu. > > > What shell I ask to the apt? > > > Thanks for the help > > Marcos > > snip > > apt-get install build-essential > > should ge