Re: Looking for regex



I offer you a solution and my comments

why use hash of 24 elements?

using a hash may brings some problem because if file is the joined day+day
you finally get a file corresponding for example a month (I use these kind
of reports of automatic station)
you can face this situation



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,Wunderground
v.1.13,
2007-01-23 01:11:00,42.9,34.8,30.13,North,1,5,6,73,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 01:17:00,42.9,34.8,30.12,NNW,346,3,7,73,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 01:23:00,43.1,35.0,30.12,North,359,5,11,73,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 02:14:00,43.2,34.1,30.10,North,0,16,16,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 02:19:00,43.2,34.1,30.09,North,0,6,13,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 02:24:00,43.2,33.7,30.09,North,349,8,14,69,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 23:04:00,43.2,34.1,30.11,North,0,7,12,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 23:09:00,43.2,34.1,30.11,North,0,10,17,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-24 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground
v.1.13,
2007-01-24 00:06:00,43.2,34.8,30.14,North,354,11,11,72,0.00,,,0.00,Wunderground
v.1.13,
2007-01-24 00:12:00,43.2,34.8,30.14,North,1,6,9,72,0.00,,,0.00,Wunderground
v.1.13,

in the 7th line it is a extra white space, because this word is not
perfect (noise, or lack of data)

then you find a 00: hour after 23 but we using hash met a problem, thereby I
offer you

perl -lne "($h=$1,print) if (/ (..):/ && $h ne $1)" datos.txt

the result is

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,North,1,5,6,73,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 02:14:00,43.2,34.1,30.10,North,0,16,16,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-23 23:04:00,43.2,34.1,30.11,North,0,7,12,70,0.00,,,0.00,Wunderground
v.1.13,
2007-01-24 00:01:00,43.3,34.9,30.14,North,359,7,8,72,0.00,,,0.00,Wunderground
v.1.13,


maybe it helps

regards


Relevant Pages

  • Re: deisel HF mobile
    ... noise on HF will be a thing of the past...but any other problems? ... RF hash from the engine management computer? ... a Merc badge. ...
    (uk.radio.amateur)
  • Re: deisel HF mobile
    ... noise on HF will be a thing of the past...but any other problems? ... RF hash from the engine management computer? ... a Merc badge. ...
    (uk.radio.amateur)
  • Re: deisel HF mobile
    ... noise on HF will be a thing of the past...but any other problems? ... RF hash from the engine management computer? ... opinion the A class is a piece of junk that doesn't deserve a Merc badge. ...
    (uk.radio.amateur)
  • Re: Failure of Pics.
    ... I suspect that a ground opened up and the noise and hash on the other ... lines got interpreted as programming commands. ... What's the power supplies behaviour wrt to input noise from ...
    (sci.electronics.design)