Hello Group,
Could you please help me with a shell script that condense in this case each 12 rows of hour information in only one row per day as following:
Final Fields in each row
1.Ticker Name
2. D (Daily)
3. Date
4. Open Price (The open price of the first record of the day)
5. High Price (The high price of all 12 rows of each day)
6. Low Price (The low price of all 12 rows of each day)
7. Close (The close price of the last record of the day)
8. Volume (The sum of all volume fields per day)
Final Result of the rows:
<ticker>,<per>,<date>,<open>,<high>,<low>,<close>,<vol>
EUR_USD,D,11/02/2009,1.4783,1.4844,1.4727,1.4772,11633
EUR_USD,D,11/03/2009,1.4732,1.4631,1.4631,1.4654,12887
The information that I want to process is in the following format:
<ticker>,<per>,<date>,<time>,<open>,<high>,<low>,<close>,<vol>
EUR_USD,I,11/02/2009,12:00,1.4783,1.4784,1.4766,1.4774,824
EUR_USD,I,11/02/2009,13:00,1.4773,1.4775,1.4746,1.4754,854
EUR_USD,I,11/02/2009,14:00,1.4753,1.4779,1.4739,1.4777,1320
EUR_USD,I,11/02/2009,15:00,1.4778,1.4844,1.4778,1.4817,2389
EUR_USD,I,11/02/2009,16:00,1.4816,1.4834,1.4813,1.4827,1302
EUR_USD,I,11/02/2009,17:00,1.4828,1.4831,1.4761,1.4762,1053
EUR_USD,I,11/02/2009,18:00,1.4761,1.4778,1.4731,1.4733,1148
EUR_USD,I,11/02/2009,19:00,1.4734,1.4771,1.4727,1.4751,1112
EUR_USD,I,11/02/2009,20:00,1.4752,1.4770,1.4747,1.4765,936
EUR_USD,I,11/02/2009,21:00,1.4764,1.4775,1.4763,1.4773,296
EUR_USD,I,11/02/2009,22:00,1.4772,1.4774,1.4760,1.4772,219
EUR_USD,I,11/02/2009,23:00,1.4773,1.4778,1.4769,1.4772,180
EUR_USD,I,11/03/2009,12:00,1.4635,1.4659,1.4631,1.4654,1207
EUR_USD,I,11/03/2009,13:00,1.4655,1.4668,1.4643,1.4651,1219
EUR_USD,I,11/03/2009,14:00,1.4652,1.4662,1.4633,1.4657,1690
EUR_USD,I,11/03/2009,15:00,1.4658,1.4696,1.4642,1.4676,2365
EUR_USD,I,11/03/2009,16:00,1.4675,1.4681,1.4631,1.4655,1592
EUR_USD,I,11/03/2009,17:00,1.4656,1.4695,1.4645,1.4685,1104
EUR_USD,I,11/03/2009,18:00,1.4686,1.4710,1.4678,1.4709,1006
EUR_USD,I,11/03/2009,19:00,1.4710,1.4732,1.4702,1.4702,988
EUR_USD,I,11/03/2009,20:00,1.4701,1.4722,1.4700,1.4711,723
EUR_USD,I,11/03/2009,21:00,1.4710,1.4732,1.4710,1.4721,371
EUR_USD,I,11/03/2009,22:00,1.4721,1.4727,1.4706,1.4716,395
EUR_USD,I,11/03/2009,23:00,1.4717,1.4732,1.4715,1.4731,227
I really appreciate your help and support
Sincerely,
Carlos S