dheadshot icon

sed regex issue 1

dheadshot | PRO | 11/12/20 10:17:15 PM UTC | 0 ⭐ | 1405 👁️ | Never ⏰ | []
Bash |

540 B

|

None

|

0 👍

/

0 👎

# The file info_s0_z100000.txt contains the output of ffmpeg's showinfo filter for a set few frames,
# complete with "\r"s and "\b"s.  I can get rid of the "\r"s as below, but not the "\b"s as that 
# means something different in sed.  However, I'm trying to just output the "pts_time" code (which
# will be "pts_time:" followed by a number).  I've tried hundreds of variations on the below to no
# avail and can't work out where I've gone wrong??!!!
cat info_s0_z100000.txt | sed 's/[\r]//g' | sed '1,$s/^.*\(pts\_time\:[0-9]+[\.0-9]*\).*$/\1/'

Comments