I need to truncate with sed everything up to and including a certain character in a line (in this case it’s ]).
Typical lines:
*15:36:40,038 [Some text] More text ...*
*15:57:40,038 [123] More text ....*
Put another away, replace everything up until the ] with nothing. What’s the neatest way of achieving this?
In prodiving suggestions, I’d be very grateful for an explanation of the regex (or usage of the bash cut command), to further my knowlegde.
many thanks
Solution
You must do it this way:
Example
Explanation
[^]]*means any symbols except]\]means]