Glam Prestige Journal

Bright entertainment trends with youth appeal.

for example my value alpha_1_2_u_345_cd.csv then i want to remove the characters present in using gsub in awk output should be 12345,alpha_1_2_u_345_cd.csv please let me know if there any evaluation to be done

Please find the execution below

enter image description here

9

1 Answer

Posted by @manatwork

{sub(/r.*/,"",$2); gsub(/[^[:digit:]]/,"",$2); print $2"|"$3"|"$4"|"$5}.

Or the gensub() way:

{print gensub(/[^[:digit:]]/,"","g",gensub(/r.*/,"",1,$2))"|"$3"|"$4"|"$5}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy