I have a file file.txt
, as follows:
24/9/2018 15:35:19,380 B63201C
9/24/2018 15:35:22,350 ES0101C (initial_time)
9/24/2018 15: 36: 13.231 Execute next service: 0003
9/24/2018 15: 38: 13,664 Result of the execution of 0003 Result: 0
9/24/2015 15: 39: 10,664 Executing the PE20 transaction
9/24/2018 15:35:26,773 ES0101C (end_time)
8/24/2018 15:36:12,164 B63201C
- 1 block -
9/24/2018 17: 16: 17.428 B63201C
9/24/2018 17: 16: 29,031 ES0101C (start_time)
9/24/2018 17: 16: 13.231 Execute next service: 0003
9/24/2018 17: 18: 13,664 Result of the execution of 0003 Result: 0
9/24/2018 17: 19: 10,664 Executing transaction BE15
9/24/2018 17: 25: 26.773 ES0101C (end_time)
9/24/2018 17: 26: 12,164 B63201C
- 2 block -
And I need to extract the data in CSV format with these fields:
date, start_time, end_time, B63201C-ES0101C, Transaction
In other words, the captured data would be:
24/9 / 2018,15: 35: 22,350.15: 35: 26.773, B63201C-ES0101C, PE20 24/9 / 2018,17: 16: 29,031.17: 25: 26.773, B63201C-ES0101C, BE15
Any way to do it in Bash or with AwK?