Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. jaiperl04

    output based on 2 unique columns

    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...
  2. jaiperl04

    group by one column and then calculate net value of another column

    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]
  3. jaiperl04

    group by one column and then calculate net value of another column

    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)...
  4. jaiperl04

    group by one column and then calculate net value of another column

    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...
  5. jaiperl04

    group by one column and then calculate net value of another column

    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...
  6. jaiperl04

    group by one column and then calculate net value of another column

    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...
  7. jaiperl04

    for each unique value in a column find the max value..need perl script

    Hi rharsh, The input1.txt has the below data: $Date,$MTime,$inserdate,$inserttime,$Id,$Phase,$Size,$day,$order 20100607 093454.666500 20100607 93454 1 263 0 10158 14077252714 20100607 093454.970000 20100607 93454 1 263 0 10158 14077252714 20100607 093454.947500 20100607 93454 1 544 0 10158...
  8. jaiperl04

    for each unique value in a column find the max value..need perl script

    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...
  9. jaiperl04

    for each unique value in a column find the max value..need perl script

    Hi, Below is my Input file: date mtime no size id day order 20100607 154538.354300 200 1 101510 14098703993 20100607 154539.420000 200 1 101511 14098703993 20100607 154538.398200 487 1 100888 14098703994 20100607 154610.720000 487 1 91588 14098703994 20100607 154538.401200 200 1 101502...

Part and Inventory Search

Back
Top