Skip to main content
9 events
when toggle format what by license comment
Aug 2, 2016 at 6:51 comment added Lesenger and those grep commands would be fine if it would print line twice if there is two time stamps in the line.
Aug 2, 2016 at 6:30 comment added Lesenger I got that sed command almost working. I didn't realize that it should be in two seperate lines. With command sed -r '/([0-9]{1,2}-){2}([0-9]{1,2}){2}|[0-9]{1,2}(:[0-9]{2}){1,2}/w outA s/[^:]*(([0-9]{1,2}-){2}([0-9]{1,2}){2}|[0-9]{1,2}(:[0-9]{2}){1,2})/\1\n/;//P;D' original right time stamps but when there is more than one time stamp in the line, command will not generate two identical lines in the output. Output is: Line 1: 8:40 routine 3, 8:45 something went south and Line 2: ` routine 3, 8:45 something went south`. This nevertheless is more than enough for my purposes. GNU sed 4.2.2
Aug 1, 2016 at 11:08 comment added Costas @Lesenger I see updated question and have to change regexp to grep -Ewo '([0-9]{1,2}-){2}([0-9]{1,2}){2}|[0-9]{1,2}(:[0-9]{2}){1,2}'
Aug 1, 2016 at 10:50 comment added Costas @Lesenger the problem can be in sed' version (viewable by sed --version) which don't have -r option. Do grep -Eo show all time stamps?
Aug 1, 2016 at 10:26 comment added Lesenger I just can't get those sed commands work. Can you explain what is happening there. And those grep commands would be nice but if there is more than one time stamp per line, grep will print just once that line.
Jul 29, 2016 at 8:39 history edited Costas CC BY-SA 3.0
added 5 characters in body
Jul 29, 2016 at 8:31 history edited Costas CC BY-SA 3.0
added 212 characters in body
Jul 29, 2016 at 8:12 history edited Costas CC BY-SA 3.0
added 125 characters in body
Jul 29, 2016 at 8:00 history answered Costas CC BY-SA 3.0