I need to remove/be rid of string as follow par of one file:
Here is my line:
2014-08-05T13:16:29+01:00 (INFO:3824.87075728): [27219] [ <[email protected]>] A message from <[email protected]> source]
As a result, I am trying to get like:
2014-08-05T13:16:29+01:00 (INFO:3824.87075728): [27219] source
In fact its to rid of the email addresses.
Thank you all for all your suggestions.
AL
I have tried to following using sed:
sed -e 's/<.* from//g'
2014-08-05T13:16:29+01:00 (INFO:3824.104725392): [27219] [ <[email protected]> source
As now, I am trying to figure how could I remove from [ until source.
Thank you.
scommand ofsed. The pattern depends on exact content you wish to remove, but as the first step you may wish to remove email-s. The basic command is sed -e "s/${EMAIL_PATTERN}//g". The exact value of ${EMAIL_PATTERN} depends on your accuracy, the official pattern is here It's a bit lengthy :)]bracket. If you want to get rid off email address then why the stringA message fromis removed?sed -e 's,\(\[\|\]\),,g;'removes all brackets from the string.