I have multiple log files, which has format as below -
A.txt
18-05-23 11:28:25.939 ##Start
18-05-23 11:28:25.940 Unique ID - ABC123
18-05-23 11:28:25.941 ##End
18-05-23 11:28:25.942 ##Start
18-05-23 11:28:25.943 Unique ID - PQR123
18-05-23 11:28:25.944 ##End
18-05-23 11:28:25.945 ##Start
18-05-23 11:28:25.946 Unique ID - MNO123
18-05-23 11:28:25.947 ##End
B.txt
18-05-23 11:28:25.949 ##Start
18-05-23 11:28:25.950 Unique ID - ABC123
18-05-23 11:28:25.951 ##End
18-05-23 11:28:25.952 ##Start
18-05-23 11:28:25.953 Unique ID - PQR123
18-05-23 11:28:25.954 ##End
18-05-23 11:28:25.955 ##Start
18-05-23 11:28:25.956 Unique ID - MNO123
18-05-23 11:28:25.947 ##End
Here, I want to create C.txt file which contains only ABC123 information starting from ##Start line to ##End line also in sorted order. check below expected output for detailed understanding.
Expected C.txt
18-05-23 11:28:25.939 ##Start
18-05-23 11:28:25.940 Unique ID - ABC123
18-05-23 11:28:25.941 ##End
18-05-23 11:28:25.949 ##Start
18-05-23 11:28:25.950 Unique ID - ABC123
18-05-23 11:28:25.951 ##End
Please suggest- how can I achieve this using shell scripting ?