My current output is as follows:
All Day Event
Someone's Birthday
Class 7:00 PM
Pick up dry cleaning 1:00 PM
Wake up 8:00 AM
I'd like the output to remain the same but have the times moved to the beginning of the line with a hyphen after it so it would look like,
All Day Event
Someone's Birthday
7:00 PM - Class
1:00 PM - Pick up dry cleaning
8:00 AM - Wake up
I assume that this can be done with awk and regex? I'm just not sure how.
I tried searching but have no idea what I'm trying to do would even be called.
The closest I got was
awk '{if ( $NF == "PM" || $NF == "AM" ) { print $(NF-1),$NF,"-",$0 } else {print $0}}'