Hi everyone,
I have got different files in a directory.
Dir1:
File 1
File 2
Sample Input Data:
File 1
$key,$No,$date,$time,$price,$units,$flag
A,1,2010-06-07,93002,10,100,Y
A,1,2010-06-07,153002,10,200,Y
B,2,2010-06-07,93002,10,100,Y
B,2,2010-06-07,153002,10,200,Y
B,2,2010-06-09,93002,10,100,Y...
Thanks prex1 :-). It works absolutely fine.. you are a star.
My apologies for not folloiwng the norms, will put the code properly next time and try to be more neat in writing my codes :-)
Many thanks
[thumbsup]
Hi prex1..
I cant make this to work... could you please help?
my code:
open(IN)
$time = "090000";$sum=0;
until($time == "173000")
{
while($line=<IN>)
{ chomp ($line);
($Date,$Mod_Time,$Precision,$Date_Inst,$Time_Inst,$Reason,$In,$Phase,$Type,$BuyorSell,$Size,$Price)= split(/ /,$line)...
Thanks prex1 again.
I might use the below:
sub snap{($hour,$minute,$second) = unpack("a2 a2 a2",$time);$second++;if($second==60){$second="00";$minute++;if($minute==60){$minute = "00";$hour++}};$time = $hour.$minute.$second;}
and then use your logic..
do you reckon it will work?
or actually i...
Thanks prex1.
They are not seconds, they refer time, so 90000 means 9:00:00am..I have just changed the format for my calculation.
So 090009.87 means 09:00:09:87.
Yes it is for one day so basically I have to group into 10 secs for 1 day between 9am to 5pm..90000 to 170000.
Hope it makes sense...
Hi,
I need some help with perl code for the below:
Input data:
$Date,$Mod_Time,$Index,$Date_Inst,$Time_Inst,$Reason,$In,$Phase,$Type,$BuyorSell,$Size,$Price
20100611 090009.870000 2 20100611 85954 5 Tes C L -1 16 43.85
20100611 090009.870000 2 20100611 90009 4 Tes C L 1 16 3.85
20100611...
Thanks Miller for the code.. Will try it now.Sorry rharsh & miller, I should have posted what I tried:
Thanks all for your reply
reformatted the date as below:
order mtime no size id day date
14098703993 154538.354300 200 1 101510
14098703993 154539.420000 200 1 101511
14098703994...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.