wademi
asked on
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_38 4_quicktim e_64
Can someone help me with the syntax to get this?
I am not sure iif C Shell has regular expression
314
4487
Files:
bad_314k_256x144_x264_250_
agel_4487k_512x288_x264_38
Can someone help me with the syntax to get this?
I am not sure iif C Shell has regular expression
echo "bad_314k_256x144_x264_250 _quicktime _64.mp4" | awk -F"_|k" '{print $2}'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have to use csh? csh is the worst shell for scripting.
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.