Article 5R3F7 escape character in sed?

escape character in sed?

by
babag
from LinuxQuestions.org on (#5R3F7)
i'm using sed with sox to parse and display info about mp3 files. i've successfully been able to print a txt file using this:
Code:for file in *.mp3

do echo '\n--------------------\n'$file'\n' # Prints a line, the filename underneath, an empty line under that.
sox $file -n stats # Prints the 'stats' output.

done 2>&1 | grep -E 'Pk lev dB|RMS lev dB|RMS Tr dB|^-|mp3$|^$' | sed -e "s/Pk lev dB/Peak Level (dB)/g; s/RMS lev dB/RMS Level (dB) /g; s/RMS Tr dB/Noise Floor (dB)/g" > stats.txti wanted to include a line about the file's length but am running into problems. i think the issue may have to do with the output from sox, which has this text:Quote:
Length s
which is followed by the file's duration in seconds.

i wanted to change that to:Quote:
Length (seconds)
but have run into trouble. it doesn't display the change in the txt file. i'm thinking that the single 's' character is messing things up but i know very little about this. here's the line i tried that is not working:
Code:done 2>&1 | grep -E 'Pk lev dB|RMS lev dB|RMS Tr dB|Length s|^-|mp3$|^$' | sed -e "s/Pk lev dB/Peak Level (dB)/g; s/RMS lev dB/RMS Level (dB) /g; s/RMS Tr dB/Noise Floor (dB)/g; s/Length s/Length (seconds)/g" > stats.txtany help getting this substitution to work is much appreciated.

thanks,
babaglatest?d=yIl2AUoC8zA latest?i=vZHyPfkEN_c:ev1QaJlVbwg:F7zBnMy latest?i=vZHyPfkEN_c:ev1QaJlVbwg:V_sGLiP latest?d=qj6IDK7rITs latest?i=vZHyPfkEN_c:ev1QaJlVbwg:gIN9vFwvZHyPfkEN_c
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments