Sas
Sas

Reputation: 2503

Replace log files time stamp with empty string

I have log files with following format:

2014-10-13.log:Mon Oct 13 02:40:11 EDT 2014: log info........
2014-10-14.log:Mon Oct 13 02:40:11 EDT 2014: log info........

I am trying to get rid of the log time stamp so that I can only have the log info.

sed 's/^2014\-*2014\:$//g'

the regular expression doesn't seem to be working. Any help would be appreciated.

Thanks

Upvotes: 1

Views: 54

Answers (1)

anubhava
anubhava

Reputation: 785058

Your regex is incorrect. You can use this sed:

sed 's/^2014.*2014: //' logFile

Upvotes: 1

Related Questions