Advertisement
dheadshot

sed regex issue 1

Nov 12th, 2020
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.54 KB | None | 0 0
  1. # The file info_s0_z100000.txt contains the output of ffmpeg's showinfo filter for a set few frames,
  2. # complete with "\r"s and "\b"s.  I can get rid of the "\r"s as below, but not the "\b"s as that
  3. # means something different in sed.  However, I'm trying to just output the "pts_time" code (which
  4. # will be "pts_time:" followed by a number).  I've tried hundreds of variations on the below to no
  5. # avail and can't work out where I've gone wrong??!!!
  6. cat info_s0_z100000.txt | sed 's/[\r]//g' | sed '1,$s/^.*\(pts\_time\:[0-9]+[\.0-9]*\).*$/\1/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement