C Shell script to get patterns n a filename

How would I get the following numbers from  the below file names using a C Shell script?

314
4487

Files:
bad_314k_256x144_x264_250_quicktime_64.mp4
agel_4487k_512x288_x264_384_quicktime_64

Can someone help me with the syntax to get this?
I am not sure iif C Shell has regular expression
wademiAsked:
Who is Participating?
 
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:
or:
echo "bad_314k_256x144_x264_250_quicktime_64.mp4" | cut -d"_" -f2 | cut -d"k" -f1

Open in new window

0
 
woolmilkporcCommented:
echo "bad_314k_256x144_x264_250_quicktime_64.mp4" | awk -F"_|k" '{print $2}'
0
 
TintinCommented:
Do you have to use csh?  csh is the worst shell for scripting.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
Why are you giving me all points? Is woolmilkporc's awk solution not working? If it is then please post a comment why you made this choice. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.